Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 当目标表是电子表格中的文件时,BigQueryAPI返回错误(python客户端)_Python 2.7_Api_Google Sheets_Google Bigquery - Fatal编程技术网

Python 2.7 当目标表是电子表格中的文件时,BigQueryAPI返回错误(python客户端)

Python 2.7 当目标表是电子表格中的文件时,BigQueryAPI返回错误(python客户端),python-2.7,api,google-sheets,google-bigquery,Python 2.7,Api,Google Sheets,Google Bigquery,当我为电子表格中的文件调用BigQueryAPI时,我得到了这个错误响应 错误:{ “错误”:{ “错误”:[ { “域”:“全局”, “原因”:“jobInternalError”, “消息”:“作业在执行过程中遇到内部错误,无法成功完成。” } ], “代码”:400, “消息”:“作业在执行过程中遇到内部错误,无法成功完成。” } } 我在python程序中调用了API,如: credentials=ServiceAccountCredentials.from\u json\u keyf

当我为电子表格中的文件调用BigQueryAPI时,我得到了这个错误响应

错误:{
“错误”:{
“错误”:[
{
“域”:“全局”,
“原因”:“jobInternalError”,
“消息”:“作业在执行过程中遇到内部错误,无法成功完成。”
}
],
“代码”:400,
“消息”:“作业在执行过程中遇到内部错误,无法成功完成。”
}
}
我在python程序中调用了API,如:

credentials=ServiceAccountCredentials.from\u json\u keyfile\u name(
密钥文件,
范围=[
'https://www.googleapis.com/auth/bigquery',
'https://www.googleapis.com/auth/drive',
])
http_auth=credentials.authorize(httplib2.http())
self.bigquery\u service=build('bigquery','v2',http=http\u auth)
query\u response=self.bigquery\u service.jobs().query(
projectId=项目ID,
body={'query':'select*from'}
).execute()
当我尝试在下使用Web UI进行相同的查询和作用域时,或者在BigQuery中查询表时,没有出现错误


我的程序出了什么问题?

确保你已经完成了这里的所有3个步骤->我错过了第3个步骤!在我与我的服务帐户共享电子表格后,我可以通过BigQuery访问它。非常感谢你!