-
Notifications
You must be signed in to change notification settings - Fork 125
project_id as optional #127
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c85a685
project_id is optional
max-sixty 8786e6d
Merge branch 'master' into default-project
max-sixty 17a2ede
gitignore
max-sixty 86b6fc5
docstring
max-sixty 11c146e
don't skip if no project
max-sixty 817c63a
formatting
max-sixty f0a8d36
add marks to allow test selecting
max-sixty 4ecfcfc
assign mark to test
max-sixty c402952
explicitly chose with auth to do from travis
max-sixty 476bcf1
too hasty to change the pandas installation
max-sixty ef59bca
do what needs doing
max-sixty 2112acd
Fixing style errors.
stickler-ci 6cc99f6
docstring & import order
max-sixty 56436ff
correct mark expression
max-sixty 5347858
project not required only if default creds available
max-sixty cd9b37d
remove any more branching in travis
max-sixty fa97b0f
Merge branch 'master' of https://github.com/pydata/pandas-gbq into de…
max-sixty a7f6c43
google import inline
max-sixty 2d50519
Merge remote-tracking branch 'upstream/master' into pr-127-maxim-lian…
tswast 7932c59
Use tuple for credentials & project for default project detection.
tswast 31e001f
lint errors.
tswast 08477cc
Remove extra project detection.
tswast 1f1f2c4
Update bad_project_id test to query actual data.
tswast d920959
Skip credentials tests if key not present.
tswast a3e6d2f
DOC: add project_id optional to changelog
tswast File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
project_id
is still required when using user authentication, so we should clarify that it is only optional if using default credentials.Or maybe also optional with a service account? I think we might have to parse as JSON and grab the project ID from the service account and use https://google-auth.readthedocs.io/en/latest/reference/google.oauth2.service_account.html#google.oauth2.service_account.Credentials.from_service_account_info for that to work.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bearing with me on the authentication questions
Is this right? If I'm running localling with user auth,
google.cloud.bigquery
can pick up my default project fine:Auth:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
google.cloud.bigquery.Client()
does user auth using the Cloud SDK. I'm referring to when the Cloud SDK is not installed, where pandas-gbq does it's user auth flow.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more specific the credential creation at
https://github.com/pydata/pandas-gbq/blob/16747609dc58f0b6df2c4e896db5a3f365c4677c/pandas_gbq/gbq.py#L272-L283
does not include a default project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bear with me once more:
Why don't we add it? It's in the JSON file:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 3LO there are two projects we are concerned with:
gcloud
command, but we don't know it if using client secrets.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I see now. Because we do the
app_flow
, those creds don't come with a project.Though not sure what 3LO is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3LO - 3-legged OAuth 2. (The protocol that
app_flow
follows.)