-
Notifications
You must be signed in to change notification settings - Fork 121
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
ArrowTypeError: Expected a string or bytes dtype, got uint8 when running to_gbq with uint8 #616
Comments
Thanks for the report! Thankfully uint8 fits inside int64, so it seems we should be using BigQuery INT64 columns for these types. |
similar kind of issue Expected bytes, got a 'int' object |
@anujsh61 Can you confirm if you're creating a new table or writing to one that already exists? |
I think the fix for this issue needs to happen here: python-bigquery-pandas/pandas_gbq/schema.py Line 108 in d921106
I suspect uint8 is hitting out "string" fallback dtype. Aside: I see we always are hitting the "table already exists" case in the google-cloud-bigquery library. Now that we're using BQ Load jobs, I think we can try removing all of our type inference logic from this library as well as the following logic to solve this issue: python-bigquery-pandas/pandas_gbq/gbq.py Lines 1350 to 1359 in d921106
and python-bigquery-pandas/pandas_gbq/gbq.py Lines 1197 to 1218 in d921106
|
Environment details
pandas-gbq
version: 0.17.9Steps to reproduce
uint8
(the default type that gets output by pandas.get_dummies, for example)ArrowTypeError: Expected a string or bytes dtype, got uint8
Code example
Stack trace
The text was updated successfully, but these errors were encountered: