ashb commented on a change in pull request #16678:
URL: https://github.com/apache/airflow/pull/16678#discussion_r660642129
##########
File path: airflow/serialization/serialized_objects.py
##########
@@ -27,6 +27,8 @@
import pendulum
from dateutil import relativedelta
+from airflow.utils.timezone import _get_tzname_or_offset
Review comment:
```suggestion
from airflow.utils.timezone import get_tzname_or_offset
```
If it's called from outside the module it shouldn't have `_` prefix.
##########
File path: airflow/serialization/serialized_objects.py
##########
@@ -228,7 +230,7 @@ def _serialize(cls, var: Any) -> Any: # Unfortunately
there is no support for r
elif isinstance(var, datetime.timedelta):
return cls._encode(var.total_seconds(), type_=DAT.TIMEDELTA)
elif isinstance(var, Timezone):
- return cls._encode(str(var.name), type_=DAT.TIMEZONE)
+ return cls._encode(_get_tzname_or_offset(var), type_=DAT.TIMEZONE)
Review comment:
```suggestion
return cls._encode(get_tzname_or_offset(var), type_=DAT.TIMEZONE)
```
--
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]