airflow.decorators.condition

Module Contents

Functions

run_if(condition[, skip_message])

Decorate a task to run only if a condition is met.

skip_if(condition[, skip_message])

Decorate a task to skip if a condition is met.

airflow.decorators.condition.run_if(condition, skip_message=None)[source]

Decorate a task to run only if a condition is met.

Parameters
  • condition (AnyConditionFunc) – A function that takes a context and returns a boolean.

  • skip_message (str | None) – The message to log if the task is skipped. If None, a default message is used.

airflow.decorators.condition.skip_if(condition, skip_message=None)[source]

Decorate a task to skip if a condition is met.

Parameters
  • condition (AnyConditionFunc) – A function that takes a context and returns a boolean.

  • skip_message (str | None) – The message to log if the task is skipped. If None, a default message is used.

Was this entry helpful?