feat: Add dtype parameters to to_geodataframe functions#2176
feat: Add dtype parameters to to_geodataframe functions#2176chalmerlowe merged 7 commits intomainfrom
Conversation
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.
|
|
||
| # autodoc/autosummary flags | ||
| autoclass_content = "both" | ||
| autodoc_default_options = {"members": True, "inherited-members": True} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Are there plans to restore the missing docs, such as reservation and job_timeout_ms on the *JobConfig classes?
| "matplotlib == 3.9.2; python_version == '3.9'", | ||
| "matplotlib >= 3.10.3; python_version >= '3.10'", | ||
| ] | ||
| tqdm = ["tqdm >= 4.23.4, < 5.0.0"] |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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.
Co-authored-by: Tim Sweña (Swast) <[email protected]>
Co-authored-by: Tim Sweña (Swast) <[email protected]>
This change adds support for
bool_dtype,int_dtype,float_dtype, andstring_dtypeparameters to theto_geodataframemethod inRowIteratorandQueryJob.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:
RowIterator.to_geodataframeto accept and pass these dtype parameters to the underlyingto_dataframemethod.QueryJob.to_geodataframeto accept and pass these dtype parameters to the underlyingRowIterator.to_geodataframemethod.Similar to #1529
Fixes #1902 🦕