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

fix: ensure SchemaField.field_dtype returns a string - #2188

Merged
chelsea-lin merged 3 commits into
mainfrom
main_chelsealin_fieldtype
May 19, 2025
Merged

fix: ensure SchemaField.field_dtype returns a string#2188
chelsea-lin merged 3 commits into
mainfrom
main_chelsealin_fieldtype

Conversation

@chelsea-lin

Copy link
Copy Markdown
Contributor

No description provided.

@chelsea-lin
chelsea-lin requested a review from tswastMay 15, 2025 22:55
@product-auto-labelproduct-auto-labelBot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels May 15, 2025
"uint16": "INTEGER",
"uint32": "INTEGER",
"geometry": "GEOGRAPHY",
"string": "STRING",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This dictionary should only get used if pandas-gbq is not installed. Let's make sure to make the same change here:

https://github.com/googleapis/python-bigquery-pandas/blob/7d354f1ca90eb2647c81d8d8422d0146d56f802a/pandas_gbq/schema/pandas_to_bigquery.py#L29

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I undid the changes after discovering the root cause: the dataframe_to_bq_schema method incorrectly relies on None for SchemaField.field_dtype, which actually required a string value. Hence, this change refactors the dataframe_to_bq_schema a little bit.

@chelsea-lin
chelsea-linforce-pushed the main_chelsealin_fieldtype branch from b7696b3 to adff18dCompareMay 16, 2025 18:58
@product-auto-labelproduct-auto-labelBot added size: l Pull request size is large. and removed size: s Pull request size is small. labels May 16, 2025
@chelsea-lin
chelsea-lin requested a review from tswastMay 16, 2025 19:02
@chelsea-lin
chelsea-lin marked this pull request as ready for review May 16, 2025 19:04
@chelsea-lin
chelsea-lin requested review from a teamMay 16, 2025 19:04
@chelsea-lin
chelsea-linforce-pushed the main_chelsealin_fieldtype branch from adff18d to aab12faCompareMay 16, 2025 20:09
@chelsea-lin
chelsea-linforce-pushed the main_chelsealin_fieldtype branch from aab12fa to 0ae6e09CompareMay 16, 2025 20:45
@chelsea-linchelsea-lin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 16, 2025
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 16, 2025
@chelsea-lin
chelsea-lin merged commit 7ec2848 into mainMay 19, 2025
@chelsea-lin
chelsea-lin deleted the main_chelsealin_fieldtype branch May 19, 2025 17:52
@release-pleaserelease-pleaseBot mentioned this pull request May 19, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.size: lPull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@chelsea-lin@tswast@Neenu1995@yoshi-kokoro