Mike Loose
02/06/2024, 7:00 PMMike Loose
02/06/2024, 7:02 PMCraig Harshbarger
02/07/2024, 12:11 AMMike Loose
02/07/2024, 12:31 AMCraig Harshbarger
02/07/2024, 12:54 AMNate
02/07/2024, 5:22 AMreturn_state
In [2]: from prefect import flow, task
In [3]: @task
...: def good():
...: return True
...:
In [4]: @task
...: def bad():
...: raise ValueError
...:
In [5]: @flow
...: def work():
...: good()
...: bad(return_state=True)
...: good()
In [6]: work()
where the flow finishes is failed and the failed task is red, but the failure of that task would not interrupt the completion of the flow. if you wanted to avoid the raised error resulting in a Failed
flow run, you'd just have to return
a non None
value from the flow e.g.
In [5]: @flow
...: def work():
...: good()
...: bad(return_state=True)
...: return good()
otherwise you're totally free to try
/ except
such errors to avoid the flow failingMike Loose
02/10/2024, 8:04 PMMike Loose
02/10/2024, 8:37 PMNate
02/10/2024, 8:38 PM