Hey guys, how would you change `BigQueryTask()` a...
# prefect-community
j
Hey guys, how would you change
BigQueryTask()
arguments at runtime? Basically I would like to be able to change the
table_dest
argument based on an environment variable, so that I can save my query result in a different place depending on if I run the flow locally or elsewhere. Thanks very much in advance
j
Hi @Jonas Hanfland I believe you should be able to do something like this:
Copy code
# initialization
task = BigQueryTask(table_dest=...)

with Flow('my flow') as flow:
    # value retrieved during runtime
    task(table_dest=new_value)
When grabbing the value from an environment variable you might want to have an upstream task which calls something like
os.getenv()
and then passes that result to the downstream bigquerytask’s table_dest kwarg
j
Great! I think this should do the job. Thank you for the quick answer