uranusjr commented on code in PR #67475:
URL: https://github.com/apache/airflow/pull/67475#discussion_r3378220875


##########
airflow-core/src/airflow/partition_mappers/window.py:
##########
@@ -106,6 +120,8 @@ class HourWindow(Window):
     expected_decoded_type: ClassVar[type] = datetime
 
     def to_upstream(self, period_start: datetime) -> Iterable[datetime]:
+        if self.direction is WindowDirection.BACKWARD:
+            period_start = period_start - timedelta(minutes=59)
         return (period_start + timedelta(minutes=i) for i in range(60))

Review Comment:
   I wonder if this if-backward pattern can be extracted instead of repeated in 
all classes.



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