Skip to content

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

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 2 commits into from
Oct 26, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
DOC: write files service account example first
  • Loading branch information
tswast authored Oct 26, 2018
commit d7a94a294c0430034144a50a764bf973d70eb2c5
20 changes: 10 additions & 10 deletions docs/source/howto/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ key file.

To use service account credentials, set the ``credentials`` parameter to the result of a call to:

* :func:`google.oauth2.service_account.Credentials.from_service_account_file`,
which accepts a file path to the JSON file.

.. code:: python

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)

* :func:`google.oauth2.service_account.Credentials.from_service_account_info`,
which accepts a dictionary corresponding to the JSON file contents.

Expand All @@ -41,16 +51,6 @@ To use service account credentials, set the ``credentials`` parameter to the res
)
df = pandas_gbq.read_gbq(sql, project_id="YOUR-PROJECT-ID", credentials=credentials)

* :func:`google.oauth2.service_account.Credentials.from_service_account_file`,
which accepts a file path to the JSON file.

.. code:: python

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)

See the `Getting started with authentication on Google Cloud Platform
<https://cloud.google.com/docs/authentication/getting-started>`_ guide for
more information on service accounts.
Expand Down