我正在使用BQ PY Client Libraries查询BQ表。但是,该表链接到外部数据源-Google表格
这是我的代码:
1) 生成凭据(指定访问{@ 3}的Google表格资源的其他范围)
SCOPES = ['https://www.googleapis.com/auth/bigquery',
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/drive']
credentials, _ = google.auth.default(scopes=SCOPES)
client = bq.Client(credentials=credentials)
query = 'SELECT * FROM `ext_tbl.sheets`'
2)
插入查询作业:client.query(query)
3)
获取结果:job.result()
并出现以下错误:
google.api_core.exceptions.NotFound:404找不到:文件 / gdrive / id / 1Y74S3YIeEu5OL2UPrOGLCrH7AZOFXgt6Z2AuZ-s6Kac