airflow.operators.subdag_operator

Module Contents

class airflow.operators.subdag_operator.SubDagOperator(subdag:DAG, session:Optional[Session]=None, *args, **kwargs)[source]

Bases: airflow.sensors.base_sensor_operator.BaseSensorOperator

This runs a sub dag. By convention, a sub dag’s dag_id should be prefixed by its parent and a dot. As in parent.child.

Although SubDagOperator can occupy a pool/concurrency slot, user can specify the mode=reschedule so that the slot will be released periodically to avoid potential deadlock.

Parameters
  • subdag – the DAG object to run as a subdag of the current DAG.

  • session – sqlalchemy session

ui_color = #555[source]
ui_fgcolor = #fff[source]
_get_dagrun(self, execution_date)[source]
_reset_dag_run_and_task_instances(self, dag_run, execution_date)[source]

Set the DagRun state to RUNNING and set the failed TaskInstances to None state for scheduler to pick up.

Parameters
  • dag_run – DAG run

  • execution_date – Execution date

Returns

None

pre_execute(self, context)[source]
poke(self, context)[source]
post_execute(self, context, result=None)[source]