blob: 254a3af539ddab21dfc3577db22a713455aa7310 [file] [log] [blame]
:py:mod:`airflow.operators.weekday`
===================================
.. py:module:: airflow.operators.weekday
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.operators.weekday.BranchDayOfWeekOperator
.. py:class:: BranchDayOfWeekOperator(*, follow_task_ids_if_true, follow_task_ids_if_false, week_day, use_task_execution_day = False, **kwargs)
Bases: :py:obj:`airflow.operators.branch.BaseBranchOperator`
Branches into one of two lists of tasks depending on the current day.
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:BranchDayOfWeekOperator`
:param follow_task_ids_if_true: task id or task ids to follow if criteria met
:param follow_task_ids_if_false: task id or task ids to follow if criteria does not met
:param week_day: Day of the week to check (full name). Optionally, a set
of days can also be provided using a set.
Example values:
* ``"MONDAY"``,
* ``{"Saturday", "Sunday"}``
* ``{WeekDay.TUESDAY}``
* ``{WeekDay.SATURDAY, WeekDay.SUNDAY}``
:param use_task_execution_day: If ``True``, uses task's execution day to compare
with is_today. Execution Date is Useful for backfilling.
If ``False``, uses system's day of the week.
.. py:method:: choose_branch(self, context)
Subclasses should implement this, running whatever logic is
necessary to choose a branch and returning a task_id or list of
task_ids.
:param context: Context dictionary as passed to execute()