https://dagster.io/ logo
#integration-bigquery
Title
# integration-bigquery
j

Juan

02/28/2023, 9:00 PM
Hi, I'm trying to make an orchestrator to send some sql queries to call some procedures. I understand that i have to use dagster_gcp.bq_op_for_queries(_sql_queries_), but i dont understand how to pass credentials (Expects a BQ client to be provisioned in resources as context.resources.bigquery) Is there some example I can use as a template. Thank you!
j

jamie

02/28/2023, 9:58 PM
hi @Juan you should be able to make the bigquery resource and add it to the job that runs the bigquery op
Copy code
from dagster_gcp import bigquery_resource, bq_op_for_queries

bq_op = bq_op_for_queries(...)

@job(
    resource_defs={"bigquery": bigquery_resource}
)
def my_bq_job():
   bq_op()
   # run other ops, etc
i typed this directly into slack so there might be a couple syntax errors. let me know if you run into issues!
j

Juan

03/01/2023, 1:13 PM
Thank you!!!
2 Views