I have a bigquery table whose data source is a google spreadsheet. I'm trying to use python to access this table but I'm encountering the following error
google.api_core.exceptions.BadRequest: 400 Error while reading table: datset.table, error message: Failed to read the spreadsheet. Errors: com.google.apps.framework.request.ForbiddenException: Permission denied [S]#RITZ#369137407806#topTeRwnQcmrdMeVQ98ZkGA
My app is authenticated with a ServiceAccount JSON token with BigQuery Admin Roles, and here is how my client is created:
from google.oauth2.service_account import Credentials
import os
scopes = [
'https://www.googleapis.com/auth/bigquery',
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/drive',
]
credentials = Credentials.from_service_account_file(os.environ['GOOGLE_APPLICATION_CREDENTIALS'], scopes=scopes)
client = bigquery.Client(credentials=credentials)
I have no problem with strict BigQuery tables, but I fail to understand what I'm doing wrong here. Thanks for your help.