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

docs: Google Colab auth is used with pydata-google-auth 1.8.0+ #631

Merged
merged 1 commit into from
May 9, 2023
Merged
Changes from all commits
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
24 changes: 19 additions & 5 deletions docs/howto/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,20 @@ authentication methods:
# The credentials and project_id arguments can be omitted.
df = pandas_gbq.read_gbq("SELECT my_col FROM `my_dataset.my_table`")

2. Application Default Credentials via the :func:`google.auth.default`
2. If running on `Google Colab <https://colab.research.google.com/>`_,
pandas-gbq attempts to authenticate with the
``google.colab.auth.authenticate_user()`` method. See the `Getting started
with BigQuery on Colab notebook
<https://colab.research.google.com/notebooks/bigquery.ipynb>`_ for an
example of using this authentication method with other libraries that use
Google BigQuery.

.. note::

To use Colab authentication, install version 1.8.0 or later of the
``pydata-google-auth`` package.

3. Application Default Credentials via the :func:`google.auth.default`
function.

.. note::
Expand All @@ -48,10 +61,11 @@ authentication methods:
user account credentials.

A common problem with default credentials when running on Google
Compute Engine is that the VM does not have sufficient scopes to query
BigQuery.
Compute Engine is that the VM does not have sufficient `access scopes
<https://cloud.google.com/compute/docs/access/service-accounts#accesscopesiam>`_
to query BigQuery.

3. User account credentials.
4. User account credentials.

pandas-gbq loads cached credentials from a hidden user folder on the
operating system.
Expand Down Expand Up @@ -214,5 +228,5 @@ more of the following circumstances:
(or similar) notebook.

If the conditions above apply to you, your needs may be better served
by the content in the `Authentication (Highly Constrained Development Environment)
by the content in the `Authentication (Highly Constrained Development Environment)
<authentication_highly_constrained_environments.html>`_ section.