GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: Add dtype parameters to to_geodataframe functions by chalmerlowe · Pull Request #2176 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Conversation

@chalmerlowe

@chalmerlowe chalmerlowe commented May 12, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

This change adds support for bool_dtype, int_dtype, float_dtype, and string_dtype parameters to the to_geodataframe method in RowIterator and QueryJob.

These parameters allow you to specify the desired pandas dtypes for boolean, integer, float, and string columns when converting BigQuery results to GeoDataFrames.

The changes include:

  • Updating RowIterator.to_geodataframe to accept and pass these dtype parameters to the underlying to_dataframe method.
  • Updating QueryJob.to_geodataframe to accept and pass these dtype parameters to the underlying RowIterator.to_geodataframe method.
  • Adding unit tests to verify the correct handling of these parameters.

Similar to #1529
Fixes #1902 🦕

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@google-labs-jules
feat: Add dtype parameters to to_geodataframe
2bd1992
This change adds support for `bool_dtype`, `int_dtype`, `float_dtype`, and `string_dtype` parameters to the `to_geodataframe` method in `RowIterator` and `QueryJob`.

These parameters allow you to specify the desired pandas dtypes for boolean, integer, float, and string columns when converting BigQuery results to GeoDataFrames.

The changes include:
- Updating `RowIterator.to_geodataframe` to accept and pass these dtype parameters to the underlying `to_dataframe` method.
- Updating `QueryJob.to_geodataframe` to accept and pass these dtype parameters to the underlying `RowIterator.to_geodataframe` method.
- Adding unit tests to verify the correct handling of these parameters.
@chalmerlowe
chalmerlowe requested review from a team and Neenu1995 May 12, 2025 11:41
@product-auto-label product-auto-label Bot added the size: m Pull request size is medium. label May 12, 2025
@blunderbuss-gcf blunderbuss-gcf Bot assigned chelsea-lin May 12, 2025
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label May 12, 2025
chalmerlowe and others added 4 commits May 14, 2025 13:11
@chalmerlowe
updates to several tests re geopandas as well as imports
b4edb9c
@chalmerlowe
updates to enum import
e49e808
@chalmerlowe
Merge branch 'main' into feat-geodataframe-dtypes
baa5981
@gcf-owl-bot
🦉 Updates from OwlBot post-processor
79cde61
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
@chalmerlowe chalmerlowe assigned tswast and unassigned chelsea-lin May 14, 2025
tswast
tswast reviewed May 14, 2025
View reviewed changes
Comment thread docs/conf.py

# autodoc/autosummary flags
autoclass_content = "both"
autodoc_default_options = {"members": True, "inherited-members": True}

@tswast tswast May 14, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about this change. What inherited members were causing problems? IIRC, there's a few methods defined in the base class for jobs that we want to make sure are documented.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chalmerlowe chalmerlowe May 14, 2025

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change re: autodoc_default_options in conf.py was added by Owlbot.
Same thing for the removal of:
"google/cloud/bigquery_v2/**", # Legacy proto-based types.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tswast reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@antdking antdking May 21, 2025

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there plans to restore the missing docs, such as reservation and job_timeout_ms on the *JobConfig classes?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pyproject.toml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread testing/constraints-3.9.txt Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pyproject.toml
"matplotlib == 3.9.2; python_version == '3.9'",
"matplotlib >= 3.10.3; python_version >= '3.10'",
]
tqdm = ["tqdm >= 4.23.4, < 5.0.0"]

@tswast tswast May 14, 2025

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[No action required] I'm curious. What forced the tqdm upgrade? 4.23.4 is still quite old, so I'm OK with this. I don't think we need to support folks who are stuck in 2016 for 4.7.4.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chalmerlowe chalmerlowe May 14, 2025

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.7.4 produced an error during unit tests that indicated something to the effect of:

  • an attribute was not present (or something similar - sorry I don't recall all the specifics of all the errors I tried to resolve). When I searched for the error the identified cause was that the older versions of tqdm did not include that attribute and it was necessary to upgrade.

I opted for 4.23.4 because it is the same version we are using in python-bigquery-pandas.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tswast reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
chalmerlowe and others added 2 commits May 14, 2025 12:02
@chalmerlowe @tswast
Update pyproject.toml
ee5533a
Co-authored-by: Tim Sweña (Swast) <[email protected]>
@chalmerlowe @tswast
Update testing/constraints-3.9.txt
d3314e0
Co-authored-by: Tim Sweña (Swast) <[email protected]>
tswast
tswast approved these changes May 14, 2025
View reviewed changes
@chalmerlowe
chalmerlowe merged commit ebfd0a8 into main May 14, 2025
@chalmerlowe
chalmerlowe deleted the feat-geodataframe-dtypes branch May 14, 2025 17:34
@release-please release-please Bot mentioned this pull request May 14, 2025
chore(main): release 3.33.0 #2180
Merged
This was referenced May 28, 2025
May 26, 2025 kitta65/bq-extension-vscode#768
Closed
May 26, 2025 kitta65/prettier-plugin-bq#660
Closed
May 26, 2025 kitta65/bq2cst#519
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@Neenu1995 Neenu1995 Awaiting requested review from Neenu1995
2 more reviewers
@antdking antdking antdking left review comments
@tswast tswast tswast approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@tswast tswast

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support string_dtype, etc. in to_geodataframe

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@chalmerlowe @tswast @antdking @chelsea-lin
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.