ebmdatalab / datalab-pandas

Useful pandas library stuff
MIT License
2 stars 2 forks source link

Handle deprecated OOB OAuth flow #32

Open rebkwok opened 1 year ago

rebkwok commented 1 year ago

OOB OAuth authentication has been deprecated and will be disabled on 1st May 2023.

This means that the prompt to go to a URL to get a token to copy/paste to authenticate with big query will no longer work; if pandas is upgraded past 1.5.0, it will default to using the local webserver flow, but with the very old versions of pandas that are allowed in this package (>=0.24) it will default to using the console flow.

Any notebooks using this package, or the datalab-jupyter image which depends on it (or pandas-gpq directly) will need to upgrade to a newer form of authentication. For notebooks, it will need to load credentials from the environment; these will need to be kept secure https://googleapis.dev/python/pandas-gbq/latest/howto/authentication.html

See this thread: https://bennettoxford.slack.com/archives/C31D62X5X/p1681815645435669

inglesp commented 1 year ago

I timeboxed a day for this and have got nowhere. I'm confused by Google's auth workflows, am stuck in dependency hell, and don't have anything like a coherent strategy for making progress.

The good news is that notebooks that use ebmdatalab.bq.cached_read continue to work (with a warning) even though we're after 1st May.

inglesp commented 1 year ago

This was addressed in #35. However, we can't update the docker images because of https://github.com/ebmdatalab/datalab-jupyter/issues/8.

Users can work around this, by changing:

df = bq.cached_read(sql, ...)

to:

df = bq.cached_read(sql, ..., auth_local_webserver=True)

See this Slack thread.

sebbacon commented 1 year ago

This is still not working, per Slack thread linked to above.

sebbacon commented 1 year ago

Error reported by @richiecroker:

image