uranusjr commented on code in PR #75847:
URL: https://github.com/apache/airflow/pull/75847#discussion_r4410581476
##########
airflow-core/src/airflow/timetables/_cron.py:
##########
@@ -162,7 +195,16 @@ def _get_next(self, current: DateTime) -> DateTime:
assert isinstance(scheduled, datetime.datetime)
if not _covers_every_hour(cron):
return convert_to_utc(make_aware(scheduled, self._timezone))
+
delta = scheduled - naive
+ if delta >= _FOLD_DELTA_LIMIT:
Review Comment:
he sub-hour shortcut is also wrong in one-hour-shift zones whenever the
transition falls on the cron's day boundary. Gating on utcoffset at both ends
instead of on delta fixes all of them.
Test cases (from Claude)
* `0 * * * 0`, America/Godthab, `_get_next(2026-10-25T00:30Z)` (Sat 23:30
−01) → `01:00Z`, which is Sat 23:00 −02. Expected `02:00Z` (Sun 00:00 −02). The
same happens for `0,10`, `0,45` and `* * * * 0`, and for Santiago in April.
* `0,30 * * * 6`, America/Havana, `_get_prev(2026-11-01T05:00Z)` (Sun 00:00
CST) → `04:30Z`, which is Sun 00:30 CDT. Expected `03:30Z` (Sat 23:30 CDT).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]