osule commented on a change in pull request #6354: [AIRFLOW-5664] Store
timestamps with microseconds precision in GCSToPSQL
URL: https://github.com/apache/airflow/pull/6354#discussion_r363380260
##########
File path: airflow/operators/postgres_to_gcs.py
##########
@@ -88,7 +90,8 @@ def convert_type(self, value, schema_type):
Decimals are converted to floats. Times are converted to seconds.
"""
if isinstance(value, (datetime.datetime, datetime.date)):
- return time.mktime(value.timetuple())
+ return pendulum.parse(
+ value.isoformat()).in_tz('UTC').float_timestamp
Review comment:
@RosterIn At the time I wrote this, I understood that the ISO-8601 string
representation for `value` could have a timezone offset and thought extra
handling necessary to convert the parsed datetime in the local time.
For a fact, this extra conversion isn't necessary to perform. I'll remove it.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services