Skip to content

Commit 257aa62

Browse files
authored
docs: Google Colab auth is used with pydata-google-auth 1.8.0+ (#631)
1 parent 1dca732 commit 257aa62

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

docs/howto/authentication.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,20 @@ authentication methods:
3838
# The credentials and project_id arguments can be omitted.
3939
df = pandas_gbq.read_gbq("SELECT my_col FROM `my_dataset.my_table`")
4040
41-
2. Application Default Credentials via the :func:`google.auth.default`
41+
2. If running on `Google Colab <https://colab.research.google.com/>`_,
42+
pandas-gbq attempts to authenticate with the
43+
``google.colab.auth.authenticate_user()`` method. See the `Getting started
44+
with BigQuery on Colab notebook
45+
<https://colab.research.google.com/notebooks/bigquery.ipynb>`_ for an
46+
example of using this authentication method with other libraries that use
47+
Google BigQuery.
48+
49+
.. note::
50+
51+
To use Colab authentication, install version 1.8.0 or later of the
52+
``pydata-google-auth`` package.
53+
54+
3. Application Default Credentials via the :func:`google.auth.default`
4255
function.
4356

4457
.. note::
@@ -48,10 +61,11 @@ authentication methods:
4861
user account credentials.
4962

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

54-
3. User account credentials.
68+
4. User account credentials.
5569

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

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

0 commit comments

Comments
 (0)