-
Notifications
You must be signed in to change notification settings - Fork 122
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
BUG: Adapt to breaking change in google-cloud-bigquery 0.32.0.dev1 #152
Conversation
del field['mode'] | ||
fields_remote = self._clean_schema_fields( | ||
self.schema(dataset_id, table_id)) | ||
fields_local = self._clean_schema_fields(schema['fields']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much nicer
I think we should either make this backwards compatible or check the version on import and raise. Otherwise people are going to get very obscure error messages if their imports aren't correct (which is very possible with pinned installs) |
Agreed. I had a hard time figuring out how to make this one backwards compatible since old versions would accept the config but then the API call to BigQuery fails later on. I've updated the version number in |
Though IIUC it's only backward incompatible for those passing in config dicts, so a very small share of users. Not worth a big lift, then |
Ah great! (some crossed wires with my last msg) |
pandas_gbq/gbq.py
Outdated
"inside config while it is specified " | ||
"as parameter") | ||
query = config['query']['query'] | ||
del config['query']['query'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worth changing, but these two could be query = config['query'].pop('query')
We could update the final build to also use master from |
@maxim-lian Good idea. I've made the "MASTER" build use the version of google-cloud-python hosted on GitHub. 5f427a0 I'll keep an eye on the MASTER build on Travis to see if it works. |
.travis.yml
Outdated
@@ -28,6 +28,7 @@ install: | |||
conda install -q numpy pytz python-dateutil; | |||
PRE_WHEELS="https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"; | |||
pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS pandas; | |||
pip install -e 'git+https://github.com/GoogleCloudPlatform/google-cloud-python.git#egg=version_subpkg&subdirectory=bigquery'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've struggled with these from time to time. I think the egg=version_subpkg
is like foo
and can be excluded. But if this works then great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably. I don't really want to mess with it, though. I got it from this answer on installing with pip from a git subdirectory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works!
Finally got a green build on MASTER. https://travis-ci.org/tswast/pandas-gbq/jobs/357606308 Got failures on the other builds as expected, since google-cloud-bigquery hasn't released 0.32.0 yet. |
There was a breaking change in 0.32.0.dev1 which changed the way configuration for the query job gets loaded. Also, it added the 'description' field to the schema resource, so this change updates the schema comparison logic to account for that. Updates the MASTER build in CI to also build with google-cloud-bigquery at MASTER.
Codecov Report
@@ Coverage Diff @@
## master #152 +/- ##
==========================================
- Coverage 78.87% 36.37% -42.5%
==========================================
Files 8 10 +2
Lines 1529 1545 +16
==========================================
- Hits 1206 562 -644
- Misses 323 983 +660
Continue to review full report at Codecov.
|
@maxim-lian I figured out how to make it backwards compatible so that we don't have to force upgrade from 0.29.0 versions. Basically, I use the same version detection code we're already doing in the Please take a look. With this new way of doing it, I think we can merge without waiting to sync with a release of |
Very nice! Good job on the backward-compat. |
Re |
Makes sense. Filed #154 to follow-up with some module renames. |
There was a breaking change in 0.32.0 which changed the way
configuration for the query job gets loaded. Also, it added the
'description' field to the schema resource, so this change updates the
schema comparison logic to account for that.
Note: I've created this PR based on the code currently in
master
in the google-cloud-bigquery repo. The tests pass locally, but they won't pass anywhere else until google-cloud-bigquery 0.32.0 is released. I've added the DO NOT MERGE label to this PR for now.Since pandas-gbq will be broken when google-cloud-bigquery does its next release, I think it would make sense to review this before than so it can be merged when everything is ready. Once it goes in, I can create a pandas-gbq release to minimize the breakage time.