airflow.operators.trigger_dagrun
¶
Module Contents¶
Classes¶
Operator link for TriggerDagRunOperator. |
|
Triggers a DAG run for a specified |
Attributes¶
- class airflow.operators.trigger_dagrun.TriggerDagRunLink[source]¶
Bases:
airflow.models.baseoperator.BaseOperatorLink
Operator link for TriggerDagRunOperator.
It allows users to access DAG triggered by task using TriggerDagRunOperator.
- get_link(operator, *, ti_key)[source]¶
Link to external system.
Note: The old signature of this function was
(self, operator, dttm: datetime)
. That is still supported at runtime but is deprecated.- Parameters
operator (airflow.models.baseoperator.BaseOperator) – The Airflow operator object this link is associated to.
ti_key (airflow.models.taskinstancekey.TaskInstanceKey) – TaskInstance ID to return link for.
- Returns
link to external system
- Return type
- class airflow.operators.trigger_dagrun.TriggerDagRunOperator(*, trigger_dag_id, trigger_run_id=None, conf=None, execution_date=None, reset_dag_run=False, wait_for_completion=False, poke_interval=60, allowed_states=None, failed_states=None, deferrable=conf.getboolean('operators', 'default_deferrable', fallback=False), **kwargs)[source]¶
Bases:
airflow.models.baseoperator.BaseOperator
Triggers a DAG run for a specified
dag_id
.- Parameters
trigger_dag_id (str) – The dag_id to trigger (templated).
trigger_run_id (str | None) – The run ID to use for the triggered DAG run (templated). If not provided, a run ID will be automatically generated.
conf (dict | None) – Configuration for the DAG run (templated).
execution_date (str | datetime.datetime | None) – Execution date for the dag (templated).
reset_dag_run (bool) – Whether clear existing dag run if already exists. This is useful when backfill or rerun an existing dag run. This only resets (not recreates) the dag run. Dag run conf is immutable and will not be reset on rerun of an existing dag run. When reset_dag_run=False and dag run exists, DagRunAlreadyExists will be raised. When reset_dag_run=True and dag run exists, existing dag run will be cleared to rerun.
wait_for_completion (bool) – Whether or not wait for dag run completion. (default: False)
poke_interval (int) – Poke interval to check dag run status when wait_for_completion=True. (default: 60)
allowed_states (list[str] | None) – List of allowed states, default is
['success']
.failed_states (list[str] | None) – List of failed or dis-allowed states, default is
None
.deferrable (bool) – If waiting for completion, whether or not to defer the task until done, default is
False
.
- template_fields: Sequence[str] = ('trigger_dag_id', 'trigger_run_id', 'execution_date', 'conf', 'wait_for_completion')[source]¶