When using Prefect 1 or 0.15, how can I know for a task with
always_run
trigger and
skip_on_upstream_skip=False
, whether any of the upstream-tasks failed or were skipped? I need this information in the task-run method.
k
Kevin Kho
07/21/2022, 11:38 PM
You can pass them as inputs into that task, I think that is the only way and they should come in as Python exceptions if they failed
s
Salim Doost
07/22/2022, 12:03 AM
OK thank you. I tried to set attributes of the task in the state-handler. That works, but I can’t figure out how to get the upstream-states within the state-handler.
k
Kevin Kho
07/22/2022, 1:00 AM
You can’t without querying the GraphQL API for them. What are you trying to do?
s
Salim Doost
07/22/2022, 1:11 AM
Understood, thank you.
I want a specific task to run always no matter what at the end of a series of tasks (not necessarily at the end of the flow) and write the status its upstream tasks to a database and sometimes also free some resources
k
Kevin Kho
07/22/2022, 1:14 AM
I think you would have to do it in the body of the task as opposed to the state handler
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.