Load Dataframe from Python to BigQuery : Access Denied



我尝试使用pandas-gbq库从python加载数据帧到BigQuery

df.to_gbq(destination_table='xxxx',
project_id='xxxxx',
if_exists='append')

但是我得到了这样的错误:

Permission bigquery.tables.get denied on table "(也可能不存在)。

但是,我已经获得权限作为编辑在谷歌项目,但为什么我不能加载数据框架bigquery?我尝试先创建表,但仍然失败。

如何对GCP进行身份验证?请参阅本文档,以使用服务帐户或用户帐户进行身份验证:

https://pandas-gbq.readthedocs.io/en/latest/howto/authentication.html

此外,您需要确保服务帐户或用户至少具有一个bigQuery角色,其中包括bigQuery .tables.get权限。例如:roles/bigquery.dataEditor

BigQuery roles: https://cloud.google.com/bigquery/docs/access-control

相关内容