uranusjr commented on code in PR #34744:
URL: https://github.com/apache/airflow/pull/34744#discussion_r1346946226
##########
airflow/serialization/serialized_objects.py:
##########
@@ -162,9 +163,9 @@ def encode_timezone(var: Timezone) -> str | int:
)
-def decode_timezone(var: str | int) -> Timezone:
+def decode_timezone(var: str | int) -> Timezone | FixedTimezone:
Review Comment:
FixedTimezone inherits from Timezone so we don’t actually need this union,
just annotating the return value as `Timezone` would work. I wonder if this is
guaranteed though (logically it should be…?)
##########
airflow/serialization/serialized_objects.py:
##########
@@ -162,9 +163,9 @@ def encode_timezone(var: Timezone) -> str | int:
)
-def decode_timezone(var: str | int) -> Timezone:
+def decode_timezone(var: str | int) -> Timezone | FixedTimezone:
Review Comment:
FixedTimezone inherits from Timezone so we don’t actually need this union,
just annotating the return value as `Timezone` would work. I wonder if this is
guaranteed though (logically it should be…?)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]