You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/10 16:43:25 UTC

[GitHub] [airflow] crhyatt commented on a change in pull request #9184: Upgrade pendulum to latest major version ~2.0

crhyatt commented on a change in pull request #9184:
URL: https://github.com/apache/airflow/pull/9184#discussion_r438265522



##########
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:
       Some of the test were failing because the function was not returning a tz aware datetime object.  Given the function is defined as returning UTC, I just forced the convention.   




----------------------------------------------------------------
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:
users@infra.apache.org