airflow.example_dags.plugins.business_day_window
Classes
A calendar-month rollup window that yields only weekday (Mon–Fri) period-starts. |
|
Class used to define AirflowPlugin. |
Module Contents
- class airflow.example_dags.plugins.business_day_window.BusinessDayWindow(*, direction=Direction.FORWARD)[source]
Bases:
airflow.partition_mappers.window.WindowA calendar-month rollup window that yields only weekday (Mon–Fri) period-starts.
The built-in
MonthWindowyields every calendar day in the month.BusinessDayWindowskips Saturdays and Sundays, so a monthly downstream asset only waits for the business-day upstream partitions — useful for financial or operational pipelines whose upstream data isn’t produced on weekends.This class demonstrates registering a custom
Windowsubclass via theAirflowPlugin.windowsregistry: any plugin that lists it inwindows = [...]makes it available toRollupMapperwithout modifying core Airflow.Assumes FORWARD direction and a day-1 month anchor — the standard contract for month-aligned temporal upstream mappers.
- to_upstream(period_start)[source]
Yield each decoded upstream item composing decoded_downstream.