potiuk commented on a change in pull request #9184:
URL: https://github.com/apache/airflow/pull/9184#discussion_r438228371
##########
File path: airflow/models/dag.py
##########
@@ -412,15 +412,15 @@ def following_schedule(self, dttm):
if not self.is_fixed_time_schedule():
# relative offset (eg. every 5 minutes)
delta = cron.get_next(datetime) - naive
- following =
dttm.in_timezone(self.timezone).add_timedelta(delta)
+ following = dttm.in_timezone(self.timezone) + delta
else:
# absolute (e.g. 3 AM)
naive = cron.get_next(datetime)
tz = pendulum.timezone(self.timezone.name)
following = timezone.make_aware(naive, tz)
return timezone.convert_to_utc(following)
elif self.normalized_schedule_interval is not None:
- return dttm + self.normalized_schedule_interval
+ return timezone.convert_to_utc(dttm +
self.normalized_schedule_interval)
Review comment:
Comment: For me it was more of a consistency with the previous return.
Agree it's not needed but you do not have to make the mental effort to check if
the dttm is in the UTC already.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]