https://prefect.io logo
k

Krzysztof Nawara

12/22/2020, 6:09 PM
Hello! If prefect pipeline fails partially (when using Pipeline.run()) is it possible to retrieve _State_s and results for the tasks that executed successfully?
j

Jim Crist-Harif

12/22/2020, 6:10 PM
Yes. If a task (or tasks) fail in
flow.run()
, the
flow.run()
call will still return the flow state with a
.result
map of all task states (successful or failed).
c

Chris White

12/22/2020, 6:11 PM
Hi @Krzysztof Nawara! Yes, when running interactively you can retrieve all task states as follows:
Copy code
flow_state = flow.run()

flow_state.result # a dictionary of Task -> State

success_states = {t: state for t, state in flow_state.result.items() if state.is_successful()}
k

Krzysztof Nawara

12/22/2020, 6:13 PM
Thanks, I'm gonna try it out!
3 Views