airflow.models.taskmixin

Module Contents

Classes

DependencyMixin

Mixing implementing common dependency setting methods methods like >> and <<.

TaskMixin

meta private

DAGNode

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 <<.

abstract property roots: Sequence[DependencyMixin][source]

List of root nodes -- ones with no upstream dependencies.

a.k.a. the "start" of this sub-graph

abstract property leaves: Sequence[DependencyMixin][source]

List of leaf nodes -- ones with only upstream dependencies.

a.k.a. the "end" of this sub-graph

abstract set_upstream(other, edge_modifier=None)[source]

Set a task or a task list to be directly upstream from the current task.

abstract set_downstream(other, edge_modifier=None)[source]

Set a task or a task list to be directly downstream from the current task.

update_relative(other, upstream=True, edge_modifier=None)[source]

Update relationship information about another TaskMixin. Default is no-op. Override if necessary.

__lshift__(other)[source]

Implements Task << Task

__rshift__(other)[source]

Implements Task >> Task

__rrshift__(other)[source]

Called for Task >> [Task] because list don't have __rshift__ operators.

__rlshift__(other)[source]

Called for Task << [Task] because list don't have __lshift__ operators.

class airflow.models.taskmixin.TaskMixin[source]

Bases: DependencyMixin

classmethod __init_subclass__()[source]
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.

abstract property node_id: str[source]
property label: str | None[source]
property dag_id: str[source]

Returns dag id if it has one or an adhoc/meaningless ID

abstract property log: logging.Logger[source]
abstract property roots: Sequence[DAGNode][source]

List of root nodes -- ones with no upstream dependencies.

a.k.a. the "start" of this sub-graph

abstract property leaves: Sequence[DAGNode][source]

List of leaf nodes -- ones with only upstream dependencies.

a.k.a. the "end" of this sub-graph

property downstream_list: Iterable[airflow.models.operator.Operator][source]

List of nodes directly downstream

property upstream_list: Iterable[airflow.models.operator.Operator][source]

List of nodes directly upstream

dag: DAG | None[source]
task_group: TaskGroup | None[source]

The task_group that contains this node

start_date: pendulum.DateTime | None[source]
end_date: pendulum.DateTime | None[source]
upstream_task_ids: set[str][source]
downstream_task_ids: set[str][source]
has_dag()[source]
set_downstream(task_or_task_list, edge_modifier=None)[source]

Set a node (or nodes) to be directly downstream from the current node.

set_upstream(task_or_task_list, edge_modifier=None)[source]

Set a node (or nodes) to be directly upstream from the current node.

get_direct_relative_ids(upstream=False)[source]

Get set of the direct relative ids to the current task, upstream or downstream.

get_direct_relatives(upstream=False)[source]

Get list of the direct relatives to the current task, upstream or downstream.

abstract serialize_for_task_group()[source]

This is used by TaskGroupSerialization to serialize a task group's content.

Was this entry helpful?