airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [airflow] kaxil commented on a change in pull request #5743: [AIRFLOW-5088][AIP-24] Persisting serialized DAG in DB for webserver scalability
Date Wed, 04 Sep 2019 13:24:34 GMT
kaxil commented on a change in pull request #5743: [AIRFLOW-5088][AIP-24] Persisting serialized
DAG in DB for webserver scalability
URL: https://github.com/apache/airflow/pull/5743#discussion_r320756016
 
 

 ##########
 File path: airflow/dag/serialization/serialization.py
 ##########
 @@ -148,7 +148,7 @@ def _serialize(cls, var):  # pylint: disable=too-many-return-statements
                 return cls._encode(var.isoformat(), type_=DAT.DATETIME)
             elif isinstance(var, datetime.timedelta):
                 return cls._encode(var.total_seconds(), type_=DAT.TIMEDELTA)
-            elif isinstance(var, pendulum.tz.Timezone):
+            elif isinstance(var, (pendulum.tz.Timezone, type(pendulum.UTC))):
 
 Review comment:
   I did have this (`pendulum.tz.timezone_info.TimezoneInfo`)  first, however IDE complained
(and so I guess mypy might have complained too - I guess not sure though): 
   
   ![image](https://user-images.githubusercontent.com/8811558/64258521-50ea9f00-cf1f-11e9-9919-92bef96ac908.png)
   
   And so I changed it to ` type(pendulum.UTC)` which checks the type of the instance created.
   
   Happy to try `pendulum.tz.timezone_info.TimezoneInfo` and see if mypy passes/fails

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


With regards,
Apache Git Services

Mime
View raw message