Mathijs Schoorl
03/05/2021, 2:12 PMnicholas
03/05/2021, 4:03 PMall_successful
; does that make sense?Mathijs Schoorl
03/05/2021, 4:27 PMall_successful
will get the status TRIGGERFAIL when one of his upstream tasks fails. So in the end it will finish with a status and then my Task with trigger manual_only
will fire and set to a paused state instead of the TRIGGERFAIL I want.nicholas
03/05/2021, 4:34 PMcase
statement to control the instantiation of that task, something like this:
control_task = ControlTask(trigger=all_successful)(upstream_tasks=[fail_on_purpose])
with case(control_task, True):
approve = ApproveTransfer(trigger=manual_only)(upstream_tasks=[control_task])
Mathijs Schoorl
03/05/2021, 4:38 PMnicholas
03/05/2021, 4:41 PMtrigger_fn(upstream_states: Set[State]) -> bool
Mathijs Schoorl
03/08/2021, 7:03 PMdef manual_trigger_adv(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 "manual_only" but some of the upstream tasks failed.'
)
if context.get("resume"):
return True
raise signals.PAUSE('Trigger function is "manual_only"')