Hi team, I am new to prefect and GCP. In <bigquery...
# ask-community
t
Hi team, I am new to prefect and GCP. In bigquery_create_table() from
prefect_bigquery
lib, what should I fill in the
location
param if I’ve specified the region for my GCP project as asia-southeast1? I’ve tried to leave it as default (“US”),fill it as
None
,
Asia
,
ASIA
, and
asia-southeast1
,but it’s kept showing the same error as below
Copy code
File <my_path_to_venv>/lib/python3.10/site-packages/prefect_gcp/bigquery.py", line 223, in bigquery_create_table
    client = gcp_credentials.get_bigquery_client(project=project, location=location)
AttributeError: 'SecretDict' object has no attribute 'get_bigquery_client'
👀 1
1
a
wanted to ask, how did you instantiate gcp_credentials?
t
Here’s my snippet
Copy code
gcp_cred = GcpCredentials.load(<my_block_name>).service_account_info

table_name = bigquery_create_table(
            dataset=dataset,
            table=table,
            gcp_credentials=gcp_cred,
            external_config=external_config,
            location="asia-southeast1")
return table_name
a
no need to use the
service_account_info
property; simply pass in gcp_cred
Copy code
gcp_cred = GcpCredentials.load(<my_block_name>)

table_name = bigquery_create_table(
            dataset=dataset,
            table=table,
            gcp_credentials=gcp_cred,
            external_config=external_config,
            location="asia-southeast1")
t
thanks, Andrew!
1
a
no problem! let me know if you have further questions.
🙌 1
1