Closed john-bodley closed 1 year ago
@mdesmet I've addressed your comments.
@aalbu or @hashhar would either of you mind merging this given than @mdesmet has approved the change?
Additionally what would be a rough estimate (days, weeks, or months) before this change would be released? The reason I'm asking is we likely need to give our Superset users—which leverages the Trino DB-API—a heads up of the issue and would ideally like to provide them with an rough ETA as to when it will be fixed.
I'll take a look tomorrow. I'm leaving some quick editorial comments for now.
Since this is a correctness issue I'd like to do a release as soon as we have this merged.
@hashhar I've addressed your comments.
Description
This PR addresses https://github.com/trinodb/trino-python-client/issues/366.
Per this article, there seemed to be merit in removing
pytz
in favor ofdateutil.tz
given that in Python 3.6 thedatetime
module remedied the ambiguous datetimes due to daylight saving time transition.Regrettably though one cannot obtain the IANA name from a
dateutil.tz
time zone—which is required when transpilingdatetime.time
/datetime.datetime
objects to Trino SQL when provided as operation parameters. Instead we use thezoneinfo
package (added to Python’s standard library in Python 3.9 and back ported) which does provide a mechanism of obtaining the specified IANA name from adatetime.datetime
/datetime.time
object, i.e.,The fix is rather simple as simply switching out the
pytz
package for thezoneinfo
package remedies the issue:Before
After
Non-technical explanation
Release notes
( ) This is not user-visible or docs only and no release notes are required. ( ) Release notes are required, please propose a release note for me. (x) Release notes are required, with the following suggested text: