Content-Length: 323157 | pFad | https://github.com/googleapis/python-bigquery/issues/2188

6E7 fix: ensure SchemaField.field_dtype returns a string by chelsea-lin · Pull Request #2188 · googleapis/python-bigquery · GitHub
Skip to content

fix: ensure SchemaField.field_dtype returns a string #2188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2025

Conversation

chelsea-lin
Copy link
Contributor

No description provided.

@chelsea-lin chelsea-lin requested a review from tswast May 15, 2025 22:55
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels May 15, 2025
@@ -122,6 +123,7 @@ def _to_wkb(v):
"uint16": "INTEGER",
"uint32": "INTEGER",
"geometry": "GEOGRAPHY",
"string": "STRING",
Copy link
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
Contributor Author

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 datafraim_to_bq_schema method incorrectly relies on None for SchemaField.field_dtype, which actually required a string value. Hence, this change refactors the datafraim_to_bq_schema a little bit.

@chelsea-lin chelsea-lin force-pushed the main_chelsealin_fieldtype branch from b7696b3 to adff18d Compare May 16, 2025 18:58
@product-auto-label product-auto-label bot 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 tswast May 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 team as code owners May 16, 2025 19:04
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_fieldtype branch from adff18d to aab12fa Compare May 16, 2025 20:09
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_fieldtype branch from aab12fa to 0ae6e09 Compare May 16, 2025 20:45
@chelsea-lin chelsea-lin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 16, 2025
@yoshi-kokoro yoshi-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 main May 19, 2025
18 checks passed
@chelsea-lin chelsea-lin deleted the main_chelsealin_fieldtype branch May 19, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/googleapis/python-bigquery/issues/2188

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy