uranusjr commented on a change in pull request #21715:
URL: https://github.com/apache/airflow/pull/21715#discussion_r816293845
##########
File path: airflow/timetables/interval.py
##########
@@ -211,6 +217,17 @@ def _align(self, current: DateTime) -> DateTime:
return next_time
return current
+ def _prev_align(self, current: DateTime) -> DateTime:
+ """Get the prev scheduled time.
+
+ This is ``current - interval``, unless ``current`` falls right on the
+ interval boundary, when ``current`` is returned.
+ """
+ prev_time = self._get_prev(current)
+ if self._get_next(prev_time) != current:
+ return prev_time
+ return current
Review comment:
Thanks for the breakdown. From this analysis it seems like a
`_prev_align` is unavoidable. However, perhaps we could rename the functions to
descibe things better. Maybe we could rename `_align` to `_align_to_next`, and
name this new function `_align_to_prev`?
--
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]