Ben Muller
10/23/2023, 8:22 AMdef my_func() -> pd.DataFrame:
futures = []
for x in range(0, 100):
futures.append(some_task.submit(x))
results = []
for f in futures:
try:
results.append(f.result(raise_on_failure=False))
except Exception:
continue
return pd.concat([r for r in results if isinstance(r, pd.DataFrame)])
and my code runs fine, but the entire flow fails with something like:
19:18:21.583 | ERROR | Flow run 'stalwart-lorikeet' - Finished in state Failed('1/228 states failed.')
I thought this should handle the failure?Ben Muller
10/23/2023, 8:23 AMtry
block with the kwarg, i was just playing around with things, but cant seem to crack itBen Muller
10/23/2023, 8:39 AMLee Mendelowitz
10/23/2023, 11:05 AMraise_on_failure
argument.
The final state of your flow is determined by its return value. If you didn’t return a value, the final state is a failure if one of the tasks or subflows in the flow run run failed, which is probably what happened here.
https://docs.prefect.io/2.13.8/concepts/flows/#final-state-determinationBen Muller
10/23/2023, 11:29 AMBen Muller
10/23/2023, 1:06 PMLee Mendelowitz
10/23/2023, 1:09 PM