Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

airflow.example_dags.plugins.custom_partition_timetable

Classes

ScheduledRuntimePartitionTimetable

A schedulable timetable whose partition key is decided at task runtime.

ScheduledRuntimePartitionTimetablePlugin

Class used to define AirflowPlugin.

Module Contents

class airflow.example_dags.plugins.custom_partition_timetable.ScheduledRuntimePartitionTimetable(cron, *, timezone, interval=datetime.timedelta(), run_immediately=False)[source]

Bases: airflow.timetables.trigger.CronTriggerTimetable

A schedulable timetable whose partition key is decided at task runtime.

Runs fire on the given cron cadence, exactly like an ordinary CronTriggerTimetable. The partition key, however, is not derived from the schedule: it is set while the producing task runs — typically after the task checks whether the period’s source data has arrived — by calling outlet_events[self].add_partitions(...).

This uses runtime partitioning on a regular cron schedule: the timetable stays schedulable (can_be_scheduled is True) yet sets partitioned_at_runtime = True so the partition key is deferred to task runtime. It differs from PartitionedAtRuntime (which also defers the key to runtime but never schedules a run on its own) and from CronPartitionTimetable (which works out the partition key from the cadence ahead of the run). partitioned stays False: no partition key is worked out ahead of the run.

Registering it via the AirflowPlugin.timetables registry makes it usable by Dag authors without modifying core Airflow.

partitioned_at_runtime = True[source]

Whether this timetable defers partition selection to task runtime.

True for PartitionedAtRuntime; downstream code can branch on this flag instead of using isinstance.

class airflow.example_dags.plugins.custom_partition_timetable.ScheduledRuntimePartitionTimetablePlugin[source]

Bases: airflow.plugins_manager.AirflowPlugin

Class used to define AirflowPlugin.

name = 'scheduled_runtime_partition_timetable_plugin'[source]
timetables[source]

Was this entry helpful?