Carlos Cueto
04/13/2022, 2:09 AM<Task: fetch_data>
. This is what I'm trying to do:
@task
def fetch_data():
return {"data": "random data"}
with Flow('Get-Data') as flow:
flow.run_config = LocalRun()
data = fetch_data()
<http://logger.info|logger.info>(data)
flow.run()
Kevin Kho
04/13/2022, 2:29 AM<http://logger.info|logger.info>
is logging during the flow build time, not during runtime. Also, your run_config should be outisde the flow
with Flow('Get-Data') as flow:
data = fetch_data()
<http://logger.info|logger.info>(data)
flow.run_config = LocalRun()
So the with Flow()
builds the DAG and the logger is running during buildtimeCarlos Cueto
04/13/2022, 2:53 AMfetch_data
during flow runtime and not build time? Would I be forced to call the <http://logger.info|logger.info>()
inside a @task
decorated function?
In addition, do you mind explaining the difference between run_config inside the flow vs outside the flow context?Kevin Kho
04/13/2022, 3:49 AMwith Flow('Get-Data') as flow:
...
build the flow and then the
flow.run_config = ...
sets a property.
It may work, but there are some edge cases where this will cause some weirdness. The Flow block is really intended to build the DAG