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 2018/08/07 20:43:18 UTC

[GitHub] bolkedebruin edited a comment on issue #3708: [AIRFLOW-2859] Implement own UtcDateTime

bolkedebruin edited a comment on issue #3708: [AIRFLOW-2859] Implement own UtcDateTime
URL: https://github.com/apache/incubator-airflow/pull/3708#issuecomment-411195033
 
 
   @ashb I think I finally nailed it. The issue was in my understanding how sqlalchemy was dealing with timezone information inside fields for mysql. If you insert in mysql `2018-08-08 20:40:21.443732+02:00` mysql will ignore the `+02:00` _and_ apply the connection's timezone setting (e.g. `set time_zone='+01:00'`). I thought sqlalchemy would handle this somehow (ie bij separating the timezone and doing something like this [1]. 
   
   So, this creates chaos obviously, although not too much as long as you do not change the connection's timezone. In my tests I was actually doing so hence they didn't pass. Strangely enough if executing them isolated / locally it worked for some reason. probably due to connection re-use. 
   
   Anyways I borrowed you event watcher and now make sure we always connect in UTC with mysql. For postgres it doesn't matter and we can test it doesn't. 
   
   [1] https://stackoverflow.com/questions/7651409/mysql-datetime-insert-a-date-with-timezone-offset

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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