blob: c28742673dc0fdfb1e547291931367899bf4425b [file] [log] [blame]
:py:mod:`airflow.models.skipmixin`
==================================
.. py:module:: airflow.models.skipmixin
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.models.skipmixin.SkipMixin
Attributes
~~~~~~~~~~
.. autoapisummary::
airflow.models.skipmixin.XCOM_SKIPMIXIN_KEY
airflow.models.skipmixin.XCOM_SKIPMIXIN_SKIPPED
airflow.models.skipmixin.XCOM_SKIPMIXIN_FOLLOWED
.. py:data:: XCOM_SKIPMIXIN_KEY
:annotation: = skipmixin_key
.. py:data:: XCOM_SKIPMIXIN_SKIPPED
:annotation: = skipped
.. py:data:: XCOM_SKIPMIXIN_FOLLOWED
:annotation: = followed
.. py:class:: SkipMixin(context=None)
Bases: :py:obj:`airflow.utils.log.logging_mixin.LoggingMixin`
A Mixin to skip Tasks Instances
.. py:method:: skip(self, dag_run, execution_date, tasks, session = NEW_SESSION)
Sets 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.
:param dag_run: the DagRun for which to set the tasks to skipped
:param execution_date: execution_date
:param tasks: tasks to skip (not task_ids)
:param session: db session to use
.. py:method:: skip_all_except(self, ti, branch_task_ids)
This method implements 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.