airflow.decorators.condition
¶
Module Contents¶
Functions¶
|
Decorate a task to run only if a condition is met. |
|
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.