Skip to content
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

ENH: Add credentials argument to read_gbq and to_gbq. #231

Merged
merged 2 commits into from
Oct 26, 2018

Conversation

tswast
Copy link
Collaborator

@tswast tswast commented Oct 26, 2018

Deprecates private_key parameter.

Note: I didn't actually add a deprecation warning message yet because I don't know which version of pandas this change will get added to.

Towards #161

@tswast tswast requested a review from max-sixty October 26, 2018 21:13
@tswast
Copy link
Collaborator Author

tswast commented Oct 26, 2018

Copy link
Contributor

@max-sixty max-sixty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!!

credentials = google.oauth2.service_account.Credentials.from_service_account_file(
'path/to/key.json',
)
df = pandas_gbq.read_gbq(sql, project_id="YOUR-PROJECT-ID", credentials=credentials)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we swap the order of these? I don't use service accounts outside of GCP much; is it right that people use files far more often than the writing the full definition?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Files are more common. Swapped.

@tswast tswast merged commit b8c9051 into googleapis:master Oct 26, 2018
@tswast tswast deleted the issue161-credentials-arg branch October 26, 2018 22:02
@max-sixty
Copy link
Contributor

🙌

@tswast tswast mentioned this pull request Oct 29, 2018
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants