airflow.providers.standard.utils.skipmixin

Attributes

XCOM_SKIPMIXIN_KEY

XCOM_SKIPMIXIN_SKIPPED

XCOM_SKIPMIXIN_FOLLOWED

Classes

SkipMixin

A Mixin to skip Tasks Instances.

Module Contents

airflow.providers.standard.utils.skipmixin.XCOM_SKIPMIXIN_KEY = 'skipmixin_key'[source]
airflow.providers.standard.utils.skipmixin.XCOM_SKIPMIXIN_SKIPPED = 'skipped'[source]
airflow.providers.standard.utils.skipmixin.XCOM_SKIPMIXIN_FOLLOWED = 'followed'[source]
class airflow.providers.standard.utils.skipmixin.SkipMixin(context=None)[source]

Bases: airflow.utils.log.logging_mixin.LoggingMixin

A Mixin to skip Tasks Instances.

skip(ti, tasks)[source]

Set tasks instances to skipped from the same dag run.

If this instance has a task_id attribute, store the list of skipped task IDs to XCom so that NotPreviouslySkippedDep knows these tasks should be skipped when they are cleared.

Parameters:
  • ti (airflow.sdk.types.RuntimeTaskInstanceProtocol) – the task instance for which to set the tasks to skipped

  • tasks (collections.abc.Iterable[airflow.sdk.definitions._internal.node.DAGNode]) – tasks to skip (not task_ids)

skip_all_except(ti, branch_task_ids)[source]

Implement the logic for a branching operator.

Given a single task ID or list of task IDs to follow, this skips all other tasks immediately downstream of this operator.

branch_task_ids is stored to XCom so that NotPreviouslySkippedDep knows skipped tasks or newly added tasks should be skipped when they are cleared.

Was this entry helpful?