John Ramirez
06/02/2021, 4:51 PMWill Milner
06/02/2021, 4:54 PMJohn Ramirez
06/02/2021, 5:13 PMKevin Kho
nicholas
query {
mapped_children(task_run_id: "<<task run id>>") {
max_end_time
min_start_time
state_counts
}
}
which will give a lot of good info about the mappingKevin Kho
all_finished
trigger to make sure the downstream task runs
import random
import prefect
from prefect import Flow, task
@task
def fail_sometimes(i):
# fail
if i == 2:
# We can either raise a signal
raise prefect.engine.signals.FAIL("FAILED")
else:
return i
# The default trigger is 'all_successful' and we need to allow failures upstream for
# this task to handle them robustly
@task(trigger=prefect.triggers.all_finished)
def check_what_failed(results):
failures = len([x for x in results if isinstance(x, Exception)])
successes = len(results) - len(failures)
return
with Flow(
"mapped-failures",
) as flow:
map_results = fail_sometimes.map([1,2,3,4])
check_what_failed(map_results)
flow.run()
John Ramirez
08/19/2021, 9:18 PMJohn Ramirez
08/19/2021, 9:22 PMKevin Kho