Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The CredentialsCache classes allow for more flexible caching of user
credentials to disk. The pydata_google_auth.cache module provides 3
canonical instances of caches:
pydata_google_auth.cache.READ_WRITE
: (default) read and write to a file in~/.config/...
, just like pandas-gbq does by default,pydata_google_auth.cache.REAUTH
: write to disk but don't read from it, just like pandas-gbq withreauth=True
,pydata_google_auth.cache.NOOP
: don't read/write to disk at all. Useful when running on shared machines.I believe this is the final implementation detail needed before releasing 0.1.0 of pydata-google-auth. The public interface includes:
pydata_google_auth.default(scopes, client_id=(pydata-auth project), client_secret=(pydata-auth project), credentials_cache=READ_WRITE, auth_local_webserver=False)
: Same as current pandas-gbq behavior. Doesgoogle.auth.default()
with fallback to user authentication.pydata_google_auth.get_user_credentials(scopes, client_id=(pydata-auth project), client_secret=(pydata-auth project), credentials_cache=READ_WRITE, auth_local_webserver=False)
: Get user credentials (loaded from cache, if available) via the 3-legged-oauth flow.I'll update the docs to remove leftovers from the pandas-gbq fork in a subsequent PR.
Towards pandas-gbq auth rewrite: googleapis/python-bigquery-pandas#161
Closes #1
@craigcitro please review