Thomas Opsomer
12/20/2021, 2:45 PMAnna Geller
12/20/2021, 3:02 PMThomas Opsomer
12/20/2021, 3:14 PM@task(
name="common.wait",
task_run_name="wait-after-{previous_task_name}",
trigger=manual_only_after_all_successful,
state_handlers=[wait_task_slack_handler],
skip_on_upstream_skip=False,
)
def wait_for_human_task(previous_task_name: str = None):
""" """
pass
• result: no there is no Result type specified on the task decorator. But it used to work in the past. How long has it been mandatory to use results to enable restarts ?Anna Geller
12/20/2021, 3:19 PMThomas Opsomer
12/20/2021, 3:31 PMdef manual_only_after_all_successful(
upstream_states: Dict["core.Edge", "state.State"]
) -> bool:
""" """
if not all(s.is_successful() for s in _get_all_states_as_set(upstream_states)):
raise signals.TRIGGERFAIL(
'Trigger was "all_successful" but some of the upstream tasks failed.'
)
if prefect.context.get("resume"):
return True
raise signals.PAUSE('Trigger function is "manual_only"')
Hum ok, some tasks have returns, not that we use it, but more as a coding habit. I'll add results to all my task and see how it goes.Anna Geller
12/20/2021, 3:37 PMThomas Opsomer
12/20/2021, 3:43 PMAnna Geller
12/20/2021, 3:44 PMThomas Opsomer
12/20/2021, 4:01 PM