airflow_ha.HighAvailabilitySensor

class airflow_ha.HighAvailabilitySensor(python_callable: Callable[[...], tuple[Result, Action]], pass_trigger_kwargs: dict[str, Any] | None = None, fail_trigger_kwargs: dict[str, Any] | None = None, *, runtime: int | timedelta | None = None, endtime: str | time | None = None, maxretrigger: int | None = None, reference_date: Literal['start_date', 'logical_date', 'data_interval_end'] = 'data_interval_end', **kwargs)[source]

Bases: PythonSensor

__init__(python_callable: Callable[[...], tuple[Result, Action]], pass_trigger_kwargs: dict[str, Any] | None = None, fail_trigger_kwargs: dict[str, Any] | None = None, *, runtime: int | timedelta | None = None, endtime: str | time | None = None, maxretrigger: int | None = None, reference_date: Literal['start_date', 'logical_date', 'data_interval_end'] = 'data_interval_end', **kwargs) → None[source]

Run a health check and branch to stop or retrigger the DAG.

The callable returns a tuple of Result and Action enum members. CONTINUE keeps the sensor polling. RETRIGGER creates another DAG run; STOP finishes monitoring. Failed outcomes select a failure branch, including after a failed retrigger schedules the next run.

Runtime and endtime limits select PASS/STOP. Exhausting maxretrigger selects STOP while preserving the last health result.

Methods

__init__(python_callable[, ...])

Run a health check and branch to stop or retrigger the DAG.

Attributes

check_end_conditions

decide_task

get_retrigger_count

is_initial_run

retrigger_fail

retrigger_pass

stop_fail

stop_pass