-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
COMPAT: gbq schema compat #13086
Comments
what exactly is the problem? you are showing lots of code which makes this very hard to grok |
Yeah, just trying to adhere to the contributing guidelines. Sorry if it's unclear! Basically I'd like verify_schema code to change. Currently it takes the schema of a BigQuery table, which will usually have name, type, mode, and possibly a description. The _generate_bq_schema code takes a pandas dataframe and creates a BigQuery-like schema that only has name and type (not mode or description). I think that verify_schema should only compare the BigQuery table's schema fields name and type to the dataframe's "schema". I just submitted my pull request here although I haven't completed all the checkboxes. That might explain it better. |
Appending dataframes to existing BigQuery tables (that weren't created by the Creating a dataframe will result in the following generated_schema:
This generated_schema will fail the verify_schema function since the schema from the BigQuery table contains
The solution is to modify |
Author: medullaskyline <[email protected]> Closes pandas-dev#13086 from medullaskyline
can you rebase / update and show tests results. |
Hi, any ETA on this? I'm currently running into this exact issue. |
duplicate / migrated to googleapis/python-bigquery-pandas#13 |
Code Sample
Expected Output
We want
verify_schema
to return True since the dataframe's columns are in the correct order, are named correctly, and have the correct types. The BigQuery table schema, however, hasdescription
andmode
in addition toname
andtype
.Therefore
verify_schema
should removedescription
andmode
from the BigQuery table schema when comparing it to the dataframe's schema.Solution:
output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: