-
Notifications
You must be signed in to change notification settings - Fork 121
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
_try_credentials requires read permissions #202
Comments
Thanks for the issue @telenieko I think supporting write-only creds is probably further off than some of the more immediate auth changes; though we may get it for free after some of the clean-up. If you need this sooner, you could try:
|
Thanks for the quick reply. |
If this works well for you, I'd be very open to a PR that offered an option to skip that step. (though @tswast let us know if you think that's a poor middle ground prior to the auth overhaul) |
I'm still thinking about how we want to handle I have a |
A short-term solution could be to only run |
I imagine, with fairly low confidence, that users with such defined permissions are a) not that common, b) sophisticated enough to supply the correct creds Edit: ...and so 👍 to your suggestion |
Trim pydata-google-auth package and add tests This is the initial version of the proposed pydata-google-auth package (to be used by pandas-gbq and ibis). It includes two methods: * `pydata_google_auth.default()` * A function that does the same as pandas-gbq does auth currently. Tries `google.auth.default()` and then falls back to user credentials. * `pydata_google_auth.get_user_credentials()` * A public `get_user_credentials()` function, as proposed in googleapis/python-bigquery-pandas#161. Missing in this implementation is a more configurable way to adjust credentials caching. I currently use the `reauth` logic from pandas-gbq. I drop `try_credentials()`, as it makes less sense when this module might be used for other APIs besides BigQuery. Plus there were problems with `try_credentials()` even for pandas-gbq (googleapis/python-bigquery-pandas#202, googleapis/python-bigquery-pandas#198).
Hi,
I am trying out pandas-gbq as part of a data loading process (we load lots of stuff into DataFrame's for cleanup and processing, and the final result is loaded into BigQuery).
On that use case, the account used needs only write access to BigQuery but _try_credentials issues a SELECT which makes it fail.
Moreover, this is run on GCP so google.auth.default() succeeds but as the SELECT fails, the library tries interactive authentication which fails.
Either _try_credentials should not require read permissions (unless on a read operation) or the method should be optional.
Related to #198
The text was updated successfully, but these errors were encountered: