airflow.operators.subdag

This module is deprecated. Please use airflow.utils.task_group. The module which provides a way to nest your DAGs and so your levels of complexity.

Module Contents

Classes

SkippedStatePropagationOptions

Available options for skipped state propagation of subdag's tasks to parent dag tasks.

SubDagOperator

This class is deprecated.

class airflow.operators.subdag.SkippedStatePropagationOptions[source]

Bases: enum.Enum

Available options for skipped state propagation of subdag's tasks to parent dag tasks.

ALL_LEAVES = all_leaves[source]
ANY_LEAF = any_leaf[source]
class airflow.operators.subdag.SubDagOperator(*, subdag: airflow.models.dag.DAG, session: Optional[sqlalchemy.orm.session.Session] = None, conf: Optional[Dict] = None, propagate_skipped_state: Optional[SkippedStatePropagationOptions] = None, **kwargs)[source]

Bases: airflow.sensors.base.BaseSensorOperator

This class is deprecated. Please use airflow.utils.task_group.TaskGroup.

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

  • conf (dict) -- Configuration for the subdag

  • propagate_skipped_state -- by setting this argument you can define whether the skipped state of leaf task(s) should be propagated to the parent dag's downstream task.

ui_color = #555[source]
ui_fgcolor = #fff[source]
pre_execute(self, context)[source]

This hook is triggered right before self.execute() is called.

poke(self, context)[source]

Function that the sensors defined while deriving this class should override.

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

This hook is triggered right after self.execute() is called. It is passed the execution context and any results returned by the operator.

Was this entry helpful?