airflow.models.taskmixin
¶
Module Contents¶
Classes¶
Mixing implementing common dependency setting methods methods like >> and <<. |
|
|
|
A base class for a node in the graph of a workflow -- an Operator or a Task Group, either mapped or |
- class airflow.models.taskmixin.DependencyMixin[source]¶
Mixing implementing common dependency setting methods methods like >> and <<.
- property roots(self)[source]¶
List of root nodes – ones with no upstream dependencies.
a.k.a. the “start” of this sub-graph
- property leaves(self)[source]¶
List of leaf nodes – ones with only upstream dependencies.
a.k.a. the “end” of this sub-graph
- abstract set_upstream(self, other)[source]¶
Set a task or a task list to be directly upstream from the current task.
- abstract set_downstream(self, other)[source]¶
Set a task or a task list to be directly downstream from the current task.
- update_relative(self, other, upstream=True)[source]¶
Update relationship information about another TaskMixin. Default is no-op. Override if necessary.
- class airflow.models.taskmixin.TaskMixin[source]¶
Bases:
DependencyMixin
- class airflow.models.taskmixin.DAGNode[source]¶
Bases:
DependencyMixin
A base class for a node in the graph of a workflow – an Operator or a Task Group, either mapped or unmapped.
- task_group :Optional[airflow.utils.task_group.TaskGroup][source]¶
The task_group that contains this node
- property roots(self)[source]¶
List of root nodes – ones with no upstream dependencies.
a.k.a. the “start” of this sub-graph
- property leaves(self)[source]¶
List of leaf nodes – ones with only upstream dependencies.
a.k.a. the “end” of this sub-graph
- set_downstream(self, task_or_task_list, edge_modifier=None)[source]¶
Set a node (or nodes) to be directly downstream from the current node.
- set_upstream(self, task_or_task_list, edge_modifier=None)[source]¶
Set a node (or nodes) to be directly downstream from the current node.
- get_direct_relative_ids(self, upstream=False)[source]¶
Get set of the direct relative ids to the current task, upstream or downstream.
- get_direct_relatives(self, upstream=False)[source]¶
Get list of the direct relatives to the current task, upstream or downstream.
- abstract serialize_for_task_group(self)[source]¶
This is used by SerializedTaskGroup to serialize a task group’s content.
- iter_mapped_dependants(self)[source]¶
Return mapped nodes that depend on the current task the expansion.
For now, this walks the entire DAG to find mapped nodes that has this current task as an upstream. We cannot use
downstream_list
since it only contains operators, not task groups. In the future, we should provide a way to record an DAG node’s all downstream nodes instead.