Keith
08/06/2022, 12:59 AMupstream_tasks
parameter that you could pass to tasks so that each task knew to wait for the previous one to run. Through my reading of the documentation it seems like this is not necessary anymore b/c everything should run like it would in Python so it basically defaults to a sequential executor. Is this the correct logic?
Obviously this story changes a bit when adding in the different Task Runners
but just wanted to confirm that using default code blocks that tasks run in sequence and won't run the next task until the previous one is complete.Nico Neumann
08/06/2022, 1:04 AMwait_for
As for as I know default should be to run task in sequential order, so there is no need to include wait_for
from prefect import flow, get_run_logger, task
@task
def task1():
logger = get_run_logger()
while True:
<http://logger.info|logger.info>("task1")
@task
def task2():
logger = get_run_logger()
while True:
<http://logger.info|logger.info>("task2")
@flow(name="Test Flow")
def flow_run():
task1()
raise Exception()
task2()
flow_run()
ConcurrentTaskRunner
https://docs.prefect.io/api-ref/prefect/task-runners/#prefect.task_runners.ConcurrentTaskRunner
Depends on your use case you might want to switch to SequentialTaskRunner