Philip MacMenamin
04/12/2021, 1:23 PMsignals.FAIL
within the task, but for some tasks I just want to exit a flow if they don't work, and not have to mark every other task dependent on that task succeeding. Anything I can look at?Kevin Kho
Philip MacMenamin
04/12/2021, 2:47 PMSkipped states are generally treated as success statesWhich led me to believe that this wasn't the standard method to exit a flow in a failed state, upon failure of a critical task. I'd like to mark the task, and flow as failed, and not attempt any further tasks if this one set up task isn't successful. This is the way to do this?
Kevin Kho
signal.FAIL
on is not an upstream dependency of the succeeding tasks, but you want those succeeding tasks to not run anymore right?Kevin Kho
Philip MacMenamin
04/12/2021, 6:12 PM@task
def my_task():
return "hello"
with Flow("my_flow", reference_tasks=[my_task]) as flow:
task_1 = my_task()
Philip MacMenamin
04/12/2021, 6:13 PMraise ValueError("reference tasks must be part of the flow.")
ValueError: reference tasks must be part of the flow.
Kevin Kho
from prefect import Flow, task
import prefect
@task
def my_task():
return "hello"
with Flow("my_flow") as flow:
task_1 = my_task()
flow.set_reference_tasks([task_1])
flow.run()
Philip MacMenamin
04/12/2021, 9:51 PM