Skip to content

Commit a9f0cf5

Browse files
authored
Clarify custom-time parameterized timetable logic (#34897) (#69151)
1 parent 7b33896 commit a9f0cf5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

airflow-core/docs/howto/timetable.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,13 @@ purpose, we'd want to do something like:
238238
run_after=DateTime.combine(end.date(), self._schedule_at).replace(tzinfo=UTC),
239239
)
240240
241+
If you adapt the first-run logic from ``AfterWorkdayTimetable`` for a custom
242+
``schedule_at`` value, compare the candidate time with ``self._schedule_at``.
243+
The midnight-specific check in the earlier example is only correct when runs
244+
are scheduled at ``00:00``. For example, an earliest time of ``06:00`` should
245+
still allow an ``08:00`` same-day run, while an earliest time of ``09:00`` should
246+
move to the next workday.
247+
241248
However, since the timetable is a part of the Dag, we need to tell Airflow how
242249
to serialize it with the context we provide in ``__init__``. This is done by
243250
implementing two additional methods on our timetable class:

0 commit comments

Comments
 (0)