I am trying to use python to read a view in BigQuery. I have previously used version 0.14.0 of pandas-gbq and authenticated using a service account by doing the following:
import pandas as pd
from google.oauth2 import service_account
credentials = service_account.Credentials.from_service_account_file(PATH_TO_JSON)
pd.read_gbq("""
SELECT
*
FROM BQ_VIEW,
project_id="PROJECT_ID",
dialect="standard",
private_key=credentials
)
Where PATH_TO_JSON, BQ_VIEW and PROJECT_ID have been filled in with the relevant info. This worked with no issues. However I am now working on another project that is using version 0.15.0 of pandas-gbq where the private_key argument is deprecated and has been replaced with credentials. Following the guide on how to authenticate using the new credentials argument with a service account I have tried the following:
import pandas as pd
from google.oauth2 import service_account
credentials = service_account.Credentials.from_service_account_file(PATH_TO_JSON)
pd.read_gbq("""
SELECT
*
FROM BQ_VIEW,
project_id="PROJECT_ID",
dialect="standard",
credentials=credentials
)
however when I run this I now get the error:
Forbidden: 403 Access Denied: BigQuery BigQuery: Permission denied while globbing file pattern
Is anyone able to advise me on where I am going wrong?
Thanks!