diff --git a/samples/query_external_sheets_permanent_table.py b/samples/query_external_sheets_permanent_table.py index 915e9acc3..31143d1b0 100644 --- a/samples/query_external_sheets_permanent_table.py +++ b/samples/query_external_sheets_permanent_table.py @@ -21,6 +21,12 @@ def query_external_sheets_permanent_table(dataset_id): # Create credentials with Drive & BigQuery API scopes. # Both APIs must be enabled for your project before running this code. + # + # If you are using credentials from gcloud, you must authorize the + # application first with the following command: + # + # gcloud auth application-default login \ + # --scopes=https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/cloud-platform credentials, project = google.auth.default( scopes=[ "https://www.googleapis.com/auth/drive", diff --git a/samples/query_external_sheets_temporary_table.py b/samples/query_external_sheets_temporary_table.py index 1b70e9531..a9d58e388 100644 --- a/samples/query_external_sheets_temporary_table.py +++ b/samples/query_external_sheets_temporary_table.py @@ -22,10 +22,16 @@ def query_external_sheets_temporary_table(): # Create credentials with Drive & BigQuery API scopes. # Both APIs must be enabled for your project before running this code. + # + # If you are using credentials from gcloud, you must authorize the + # application first with the following command: + # + # gcloud auth application-default login \ + # --scopes=https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/cloud-platform credentials, project = google.auth.default( scopes=[ "https://www.googleapis.com/auth/drive", - "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform", ] )