Triggers


Triggers are functions that determine if task state should change based on the state of preceding tasks.

Functions

top-level functions:                                                                                                                                                       

prefect.triggers.all_finished

(upstream_states)[source]

This task will run no matter what the upstream states are, as long as they are finished.

Args:

  • upstream_states (set[State]): the set of all upstream states

prefect.triggers.manual_only

(upstream_states)[source]

This task will never run automatically, because this trigger will always place the task in a Paused state. The only exception is if the "resume" keyword is found in the Prefect context, which happens automatically when a task starts in a Resume state.

Args:

  • upstream_states (set[State]): the set of all upstream states

prefect.triggers.all_finished

(upstream_states)[source]

This task will run no matter what the upstream states are, as long as they are finished.

Args:

  • upstream_states (set[State]): the set of all upstream states

prefect.triggers.all_successful

(upstream_states)[source]

Runs if all upstream tasks were successful. Note that SKIPPED tasks are considered successes and TRIGGER_FAILED tasks are considered failures.

Args:

  • upstream_states (set[State]): the set of all upstream states

prefect.triggers.all_failed

(upstream_states)[source]

Runs if all upstream tasks failed. Note that SKIPPED tasks are considered successes and TRIGGER_FAILED tasks are considered failures.

Args:

  • upstream_states (set[State]): the set of all upstream states

prefect.triggers.any_successful

(upstream_states)[source]

Runs if any tasks were successful. Note that SKIPPED tasks are considered successes and TRIGGER_FAILED tasks are considered failures.

Args:

  • upstream_states (set[State]): the set of all upstream states

prefect.triggers.any_failed

(upstream_states)[source]

Runs if any tasks failed. Note that SKIPPED tasks are considered successes and TRIGGER_FAILED tasks are considered failures.

Args:

  • upstream_states (set[State]): the set of all upstream states

prefect.triggers.some_failed

(at_least=None, at_most=None)[source]

Runs if some amount of upstream tasks failed. This amount can be specified as an upper bound (at_most) or a lower bound (at_least), and can be provided as an absolute number or a percentage of upstream tasks.

Note that SKIPPED tasks are considered successes and TRIGGER_FAILED tasks are considered failures.

Args:

  • at_least (Union[int, float], optional): the minimum number of upstream failures that must occur for this task to run. If the provided number is less than 0, it will be interpreted as a percentage, otherwise as an absolute number.
  • at_most (Union[int, float], optional): the maximum number of upstream failures to allow for this task to run. If the provided number is less than 0, it will be interpreted as a percentage, otherwise as an absolute number.

prefect.triggers.some_successful

(at_least=None, at_most=None)[source]

Runs if some amount of upstream tasks succeed. This amount can be specified as an upper bound (at_most) or a lower bound (at_least), and can be provided as an absolute number or a percentage of upstream tasks.

Note that SKIPPED tasks are considered successes and TRIGGER_FAILED tasks are considered failures.

Args:

  • at_least (Union[int, float], optional): the minimum number of upstream successes that must occur for this task to run. If the provided number is less than 0, it will be interpreted as a percentage, otherwise as an absolute number.
  • at_most (Union[int, float], optional): the maximum number of upstream successes to allow for this task to run. If the provided number is less than 0, it will be interpreted as a percentage, otherwise as an absolute number.

This documentation was auto-generated from commit n/a
on August 8, 2019 at 15:41 UTC