uranusjr commented on code in PR #34683: URL: https://github.com/apache/airflow/pull/34683#discussion_r1348362770
########## 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: What’s the type of `o` here without the cast? ########## 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: What’s the type of `o` here without the cast? -- 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