-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
On demand imports failing in pandas.io.gbq #9713
Comments
this is not tested on Travis at all though worked for me locally but certainly could be buggy |
@cgrin the way to fix this is to either:
|
Thanks for the info. I'll look into this when I get a chance. I think it makes sense to import in the function that needs to use the import, is there any advantage to the global imports method? |
no, the global import really was just to avoid everything in pandas importing this (or trying to) |
cc @jacobschaer |
Alright, I'll put together a PR that moves the imports into the functions that use them. |
@cgrin @jreback- @sean-schaefer and I were looking at refactoring for #8327 and this issue came up which prompted a couple questions for you: Within the read_gbq() and to_gbq() functions, we are creating a Oauth connector object and doing various Oauth things, so we would have to move all of the required imports and objects into the namespace for each function (things like oauth2client.client and oauth2client.file.storage, etc). In order to refactor the code to remove the deprecated tools.run(), we have to get all the imports working. -Should we wait for @cgrin to refactor the existing code and get imports working? If you share your strategy for managing this, we could work on it ourselves although it might be a couple weeks given we are doing a hackathon one night per week. We were also going to look at the CI testing as even though we can't test against Google (despite talking to their engineering team to try to get a test account), we should at least catch things like this. Let us know your thoughts. cc @jacobschaer |
I am going to put in @cgrin refactor for 0.16.1. (just needs a rebase) as its pretty straightforward and fixes the broken-ness now. Would fully +1 on testing! (esp on travis!). |
@jreback Great. @sean-schaefer, @jacobschaer and I will add travis CI testing to the top of our pandas backlog. |
commit 3d6fdc8751134f6e5bac700519358cf9a700aba1 Author: Chris Grinolds <[email protected]> Date: Wed Apr 29 21:43:10 2015 -0700 Added missing imports that caused tests to fail commit 6c345d8dbc0c36bd4369dd220eceb495ab5ff2c6 Author: Chris Grinolds <[email protected]> Date: Wed Apr 29 16:23:01 2015 -0700 Updated test suite to handle changes to gbq.py commit f43e65f924d07f88bbbe308b9ea396b1f2a720f9 Author: Chris Grinolds <[email protected]> Date: Wed Apr 29 08:46:00 2015 -0700 Updated BigQuery connector to no longer use deprecated ```oauth2client.tools.run() (#8327) commit ea92e200ff341a3025b06868a565b1eea506c4c2 Author: Chris Grinolds <[email protected]> Date: Wed Apr 29 08:43:43 2015 -0700 Import BigQuery dependencies on a per-method basis (#9713)
closed by #9722 |
After upgrading to 0.16.0 BigQuery functionality is not working. Upon invoking pd.read_gbq(), the _test_imports() function is running, which in turn runs _importers(). Everything is all well and good up to here, but per pdb, once _importers() returns, the imported modules are not accessible and read_gbq() throws
NameError: global name 'OAuth2WebServerFlow' is not defined
.The text was updated successfully, but these errors were encountered: