Florent VanDeMoortele
08/31/2023, 4:47 PMMarvin
08/31/2023, 4:47 PMFlorent VanDeMoortele
08/31/2023, 4:49 PMMarvin
08/31/2023, 4:49 PMNate
08/31/2023, 5:40 PMIn [3]: from prefect import task, flow
In [4]: from prefect.task_runners import SequentialTaskRunner
In [5]: from prefect.context import get_run_context
...:
...: @flow(task_runner=SequentialTaskRunner)
...: def child():
...: print(get_run_context())
...:
In [6]: @flow(log_prints=True)
...: def foo():
...: print(get_run_context())
...: child()
i think if you specify a task_runner for a flow, it will always be used (on any tasks submitted) and if you don't specify one, it will use the default prefect.task_runners.ConcurrentTaskRunner
Florent VanDeMoortele
09/01/2023, 7:57 AM