You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/06/24 12:05:50 UTC

[GitHub] [airflow] ashb commented on a change in pull request #16631: Change timezone serialization logic

ashb commented on a change in pull request #16631:
URL: https://github.com/apache/airflow/pull/16631#discussion_r657885709



##########
File path: airflow/serialization/serialized_objects.py
##########
@@ -195,6 +196,24 @@ def serialize_to_json(
                 serialized_object[key] = value
         return serialized_object
 
+    @classmethod
+    def serialize_timezone(cls, var: datetime.tzinfo) -> Any:
+        """Serializes a timezone to json"""
+        tz_name = None
+        try:
+            tz_name = var.name
+        except AttributeError:
+            pass

Review comment:
       ```suggestion
           tz_name = getattr(var, 'name', None)
   ```




-- 
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.

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