artur
02/23/2024, 5:00 PMCOMPLETE_WITH_ERRORS
or something similar to distinguish unexpected failures from the ones we tolerate?Marvin
02/23/2024, 5:00 PMCOMPLETE_WITH_ERRORS
or something similar directly out-of-the-box. However, Prefect has introduced automated error summaries in the latest release of Prefect Cloud (according to Prefect Blog), which can help to triage and manage failed runs quickly. This might not mark the whole flow in a specific way but gives a path to detect and analyze any errors that occur, including those that are tolerated by the allow_failure
parameter of tasks.
For flaky tasks, you could consider using a combination of retries and the allow_failure
parameter to handle failures. If you want to mark the flow in a certain way after completion, you might have to implement some custom logic within your flow to check task statuses and then set a flow-level status or message manually based on those. This would likely be a combination of querying the state of the tasks within the flow and then using a conditionally run task to set the overall flow message/status.
If there are any more recent updates or community practices around this, we might find something relevant on GitHub issues or discussions, so let's consider searching there as well. Would you like me to search GitHub for any discussions or issues related to handling flaky tasks or marking flows with a certain status on Prefect?Nate
02/23/2024, 6:12 PMCompleted
state when you handle the errorNate
02/23/2024, 6:13 PMfrom prefect.states import Completed
@flow
def something():
try:
flaky_code():
except SomeException:
return Compeleted(message="its ok", name="CompletedWithErrors")
Gregory Hunt
02/23/2024, 10:37 PMFinished in state Failed('1/11 states failed.')
Nate
02/23/2024, 10:42 PM