You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "dimberman (via GitHub)" <gi...@apache.org> on 2023/02/19 20:10:14 UTC

[GitHub] [airflow] dimberman commented on a diff in pull request #29606: convert moment with timezone to UTC instead of raising an exception

dimberman commented on code in PR #29606:
URL: https://github.com/apache/airflow/pull/29606#discussion_r1111314236


##########
airflow/triggers/temporal.py:
##########
@@ -41,10 +41,8 @@ def __init__(self, moment: datetime.datetime):
         # Make sure it's in UTC
         elif moment.tzinfo is None:
             raise ValueError("You cannot pass naive datetimes")
-        elif not hasattr(moment.tzinfo, "offset") or moment.tzinfo.offset != 0:  # type: ignore
-            raise ValueError(f"The passed datetime must be using Pendulum's UTC, not {moment.tzinfo!r}")
         else:
-            self.moment = moment
+            self.moment = timezone.convert_to_utc(moment)

Review Comment:
   @Taragolis looks like there are tests added. Do you think there should be more testing?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org