phanikumv commented on code in PR #68718:
URL: https://github.com/apache/airflow/pull/68718#discussion_r3449528945


##########
airflow-core/src/airflow/timetables/trigger.py:
##########
@@ -494,16 +495,16 @@ def iter_partition_dagrun_infos(
         final tiebreaker).  Setting ``run_after = partition_date`` is the 
simplest
         correct choice and avoids the need for a reverse mapping.
 
-        :param earliest_date: inclusive lower bound calendar date; the UTC 
window start is
-            ``resolve_day_bound(earliest_date)``, i.e. local midnight of that 
day.
-        :param latest_date: inclusive upper bound calendar date; the UTC 
window end is
-            ``resolve_day_bound(latest_date + 1 day)`` (exclusive), so all 
ticks within
-            ``latest_date``'s local day are included.
+        :param earliest: inclusive lower bound on ``partition_date``; 
iteration starts at
+            the first cron tick at or after it (``_align_to_next``).
+        :param latest: inclusive upper bound on ``partition_date``; the tick 
equal to it
+            is included.
+
+        Both bounds must be timezone-aware; a naive datetime is coerced to UTC.
         """
-        earliest_partition_date = self.resolve_day_bound(earliest_date)
-        latest_partition_date = self.resolve_day_bound(latest_date + 
timedelta(days=1))
-        current = self._align_to_next(earliest_partition_date)
-        while current < latest_partition_date:
+        current = self._align_to_next(coerce_datetime(earliest))
+        latest_dt = coerce_datetime(latest)
+        while current <= latest_dt:

Review Comment:
   This `_align_to_next(coerce_datetime(earliest))` + `current <= latest_dt` 
logic
   treats the bounds as raw UTC instants, which reintroduces the 
timezone-boundary bug #67537 fixed. 
   
   For example, a Taipei "0 0 * * *" Dag backfilled 2026-02-15→2026-02-24 on a 
UTC instance, earliest is 2026-02-15T00:00Z but the 2026-02-15 partition ticks 
at 2026-02-14T16:00Z — so `_align_to_next` jumps past it and the first 
requested day is silently lost (9 runs, not 10). The backfill CLI/API attach [ 
core] default_timezone, never the timetable tz, so this is the default path.
   
   `test_create_backfill_partitioned_non_utc_boundary` is failing on CI for 
exactly
   this reason



-- 
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]

Reply via email to