airflow.models.taskmixin¶

Module Contents¶

class airflow.models.taskmixin.TaskMixin[source]¶

Mixing implementing common chain methods like >> and <<.

In the following functions we use: Task = Union[BaseOperator, XComArg] No type annotations due to cyclic imports.

roots[source]¶

Should return list of root operator List[BaseOperator]

leaves[source]¶

Should return list of leaf operator List[BaseOperator]

set_upstream(self, other: Union['TaskMixin', Sequence['TaskMixin']])[source]¶

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

set_downstream(self, other: Union['TaskMixin', Sequence['TaskMixin']])[source]¶

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

update_relative(self, other: 'TaskMixin', upstream=True)[source]¶

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

__lshift__(self, other: Union['TaskMixin', Sequence['TaskMixin']])[source]¶

Implements Task << Task

__rshift__(self, other: Union['TaskMixin', Sequence['TaskMixin']])[source]¶

Implements Task >> Task

__rrshift__(self, other: Union['TaskMixin', Sequence['TaskMixin']])[source]¶

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

__rlshift__(self, other: Union['TaskMixin', Sequence['TaskMixin']])[source]¶

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

Was this entry helpful?