Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 20c9024

Browse files
authored
docs: show gcloud command to authorize against sheets (#1045)
Fixes #805
1 parent 7c5fa8a commit 20c9024

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

samples/query_external_sheets_permanent_table.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ def query_external_sheets_permanent_table(dataset_id):
2121

2222
# Create credentials with Drive & BigQuery API scopes.
2323
# Both APIs must be enabled for your project before running this code.
24+
#
25+
# If you are using credentials from gcloud, you must authorize the
26+
# application first with the following command:
27+
#
28+
# gcloud auth application-default login \
29+
# --scopes=https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/cloud-platform
2430
credentials, project = google.auth.default(
2531
scopes=[
2632
"https://www.googleapis.com/auth/drive",

samples/query_external_sheets_temporary_table.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ def query_external_sheets_temporary_table():
2222

2323
# Create credentials with Drive & BigQuery API scopes.
2424
# Both APIs must be enabled for your project before running this code.
25+
#
26+
# If you are using credentials from gcloud, you must authorize the
27+
# application first with the following command:
28+
#
29+
# gcloud auth application-default login \
30+
# --scopes=https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/cloud-platform
2531
credentials, project = google.auth.default(
2632
scopes=[
2733
"https://www.googleapis.com/auth/drive",
28-
"https://www.googleapis.com/auth/bigquery",
34+
"https://www.googleapis.com/auth/cloud-platform",
2935
]
3036
)
3137

0 commit comments

Comments
 (0)