-
-
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
GBQ: Handle deprecation of oauth2client.tools.run() #8327
Comments
Using |
gotcha - maybe it's just that we need to invoke it differently or something. On Fri, Sep 19, 2014 at 8:47 PM, Jacob Schaer [email protected]
|
@jtratner I would be careful with any of the Google client libraries including gcloud. I've been testing a Java library they have which uses gcloud and it apparently uses some custom interval version of boto which conflicted with my desktop python distro's boto library. So, the only way I could get it to work was to run their java code from within a clean python virtual environment. As Jacob said, I would suggest sticking to the APIs. I'm not sure about the need, but another potential feature for your hackathon might also be some method for authenticating in a server environment. Also, if you want to talk about testing or how we set up the pypandas.test@gmail.com for Oauth, let us know. |
@azbones @jacobschaer I agree - we definitely don't want to rely on some internal and undocumented method to get to authentication. Right now, it looks like we might actually be able to just pull local credentials like gcloud does, but we could probably just let people specify a path to their credentials file and avoid the need to authorize their credentials to an external application, rather than using Google's helpers for getting to the credentials file. If that's not available, then fall back oauth2client.tools.run |
If there is anything we can do to help, just let us know. I think analytics focused services like BQ and pandas are great for developing a powerful analysis workflow. |
Ah, got it and that makes sense. I'll try catching up with @jacobschaer also given he was looking into it. |
Any news on this one? I'm packager of pandas on Arch Linux and gflags is only dependency left that isn't compatible with python 3 - and seems won't be in any time soon. Even google-api-python-client |
@aginiewicz IIRC gbq is not tested / enabled for py3 at all. I am not sure that status in general. cc @jacobschaer |
Hey @jtratner, @jacobschaer and I are going to try to look at the following in the next week: -options for Google's deprecating oauth2client.tools.run() method |
@jacobschaer @sean-schaefer @jtratner Also, I just saw #9713, so we can look at testing again as we should catch things like that. |
@azbones Just came over to take a look at this and did a bit of digging. It's actually not a huge change, and I've already written a patch to fix it. The replacement for tools.run is tools.run_flow(). Change the import from from oauth2client.tools import run to from oauth2client.tools import run_flow, argparser and invoke with credentials = run_flow(flow, storage, argparser.parse_args([])) Not sure if I should push this to #9722 or wait for that to accept, and make a new pull for this issue. @jreback @jacobschaer - Thoughts on how to handle this? |
@cgrin Cool- that is the same conclusion we had come to! We'll leave it to you, but let us know if you need any help. The other feature we were thinking about in gbq was #8489 which is generally focused on an improved auth flow for servers. We haven't researched that one yet, but I think someone had taken a cut at it. |
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 |
….tools.run by switching [1] to run_flow The warnging text is: WARNING:root:This function, oauth2client.tools.run(), and the use of the gflags library are deprecated and will be removed in a future version of the library. [1]: pandas-dev/pandas#8327 (comment)
Right now, when you use GbqConnector, you get the following warning:
I'm not sure how quickly this deprecation will happen or if there are alternatives to keep things the way that they are; but at least worthwhile to have an issue here to address it (in the future).
As an aside, I've been glancing at the source for the
bq
client that Google provides as part of Google Cloud SDK and I'm wondering how public the methods are (i.e., if we could adapt some of the code or functions thatbq.py
uses to authenticate and be able to get credentials set up fromgcloud auth login
rather than requiring a separate oauth flow). Not sure though.Again, cc @jacobschaer , I'd be interested in your opinion on whether this is worth investigating at all. I've been finding
read_gbq
andto_gbq
quite useful - thanks for putting it together!The text was updated successfully, but these errors were encountered: