Lee-W commented on code in PR #68718:
URL: https://github.com/apache/airflow/pull/68718#discussion_r3457155537
##########
airflow-core/src/airflow/timetables/trigger.py:
##########
@@ -463,17 +468,39 @@ def _get_partition_info(self, run_date: DateTime) ->
tuple[DateTime, str]:
partition_key = self._format_key(partition_date)
return partition_date, partition_key
+ def _localize_wall_clock_to_timetable_timezone(self, dt:
datetime.datetime) -> DateTime:
+ """
+ Re-interpret *dt*'s wall-clock reading as a moment in this timetable's
timezone.
+
+ The production backfill path attaches ``default_timezone`` (UTC) to the
+ bounds it passes in, but the user's intent is the same wall-clock time
in
+ the timetable's local timezone. This method extracts the naive
+ year/month/day/hour/minute/second from *dt* (regardless of whatever
+ tzinfo it currently carries) and re-localises that wall-clock to
+ ``self._timezone``, returning a UTC instant.
+
+ Crucially it preserves sub-day precision — the hour, minute, and second
+ are kept intact — so a narrow hourly window is not widened to a whole
day.
+ """
+ aware = coerce_datetime(dt)
+ naive = datetime.datetime(
+ aware.year, aware.month, aware.day, aware.hour, aware.minute,
aware.second, aware.microsecond
+ )
Review Comment:
right... just updated it
--
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]