0
votes

I tried to load a dataframe from python to BigQuery using pandas-gbq library

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

But I get an error like this:

Permission bigquery.tables.get denied on table "xxxxx" (or it may not exist).

But, I already get permission as Editor in google project, but why did I can not load dataframe bigquery? I tried to create the table first, but still failed.

1

1 Answers

0
votes

How are you authenticating against GCP? Please refer to this doc in order to authenticate using Service Account or User Account:

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

Also, you need to make sure the service account or user have at least one of the bigQuery roles which includes bigquery.tables.get permission. For example: roles/bigquery.dataEditor

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