bolkedebruin commented on code in PR #34683:
URL: https://github.com/apache/airflow/pull/34683#discussion_r1348547524


##########
airflow/serialization/serializers/timezone.py:
##########
@@ -43,21 +48,26 @@ def serialize(o: object) -> tuple[U, str, int, bool]:
     0 without the special case), but passing 0 into ``pendulum.timezone`` does
     not give us UTC (but ``+00:00``).
     """
-    from pendulum.tz.timezone import FixedTimezone, Timezone
+    from pendulum.tz.timezone import FixedTimezone
 
     name = qualname(o)
+
     if isinstance(o, FixedTimezone):
         if o.offset == 0:
             return "UTC", name, __version__, True
         return o.offset, name, __version__, True
 
-    if isinstance(o, Timezone):
-        return o.name, name, __version__, True
+    tz_name = _get_tzinfo_name(cast(datetime.tzinfo, o))

Review Comment:
   No need to, as the serializer only gets called with 
Timezone/Zoneinfo/FixedTimezone and these are guaranteed to be derived from 
tzinfo it will be indeed a `tzinfo` object. However, the signature to be 
compatible with the 'plugin' is to use object. So the choice here is a bit 
arbitrary. I guess it is a bit the downside of using lazy loading.



-- 
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-unsubscr...@airflow.apache.org

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

Reply via email to