-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Time zone information lost for some dateutil time zones #9663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
see #9123 for an open pull-request to 'fix' this. and these issues: dateutil/dateutil#8 I don't actually think this is a regression in pandas itself. Dateutil supported various ways of accessing the tz's which differed on different platforms. So would love to have someone work/on resolve this. #9123 is almost there. |
python-dateutil provides two implementations for gettz(), tz.gettz() and zoneinfo.gettz(). The former tries first to use system provided timezone data, where as the later always uses a bundled tarball. Upstreams recommandation for library consumers is only using tz.gettz() (1 & 2). Further more, on system which do not install the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system zoneinfo files the direct usage of zoneinfo.gettz() creates problems which result in test failures (3 - 6). For compatibility in pandas code pandas.tslib._dateutil_gettz() should be used. 1 dateutil/dateutil#8 2 dateutil/dateutil#11 3 pandas-dev#9059 4 pandas-dev#8639 5 pandas-dev#10121 6 pandas-dev#9663 Signed-off-by: Justin Lecher <[email protected]>
python-dateutil provides two implementations for gettz(), tz.gettz() and zoneinfo.gettz(). The former tries first to use system provided timezone data, where as the later always uses a bundled tarball. Upstreams recommandation for library consumers is only using tz.gettz() (1 & 2). Further more, on system which do not install the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system zoneinfo files the direct usage of zoneinfo.gettz() creates problems which result in test failures (3 - 6). For compatibility in pandas code pandas.tslib._dateutil_gettz() should be used. 1 dateutil/dateutil#8 2 dateutil/dateutil#11 3 pandas-dev#9059 4 pandas-dev#8639 5 pandas-dev#10121 6 pandas-dev#9663 Signed-off-by: Justin Lecher <[email protected]>
python-dateutil provides two implementations for gettz(), tz.gettz() and zoneinfo.gettz(). The former tries first to use system provided timezone data, where as the later always uses a bundled tarball. Upstreams recommandation for library consumers is only using tz.gettz() (1 & 2). Further more, on system which do not install the zoninfo tarball (e.g. Debian, Gentoo and Fedora) but rely on the system zoneinfo files the direct usage of zoneinfo.gettz() creates problems which result in test failures (3 - 6). For compatibility in pandas code pandas.tslib._dateutil_gettz() should be used. 1 dateutil/dateutil#8 2 dateutil/dateutil#11 3 pandas-dev#9059 4 pandas-dev#8639 5 pandas-dev#10121 6 pandas-dev#9663 Signed-off-by: Justin Lecher <[email protected]>
we merged #9123 so is this relevant any longer? |
@miketkelly pls reopen if this is still an issue |
The dateutil package allows you to create time zone (
tzfile
) objects two ways, either by usingdateutil.tz.gettz
to read time zone data on the file system (/usr/share/zoneinfo), or by usingdateutil.zoneinfo.gettz
to read time zone data from a tar file distributed in the dateutil package.The
tslib.maybe_get_tz
function doesn't handle thedateutil.tz.gettz
variant.maybe_get_tz
returns None for tz1, but works correctly for tz2:And so DatetimeIndexes are missing time zone information for those cases.
I think if
maybe_get_tz
where to first try dateutil.zoneinfo.gettz, and then fall back on dateutil.tz.gettz, then the problem is solved.This was a regression between 0.14 and 0.15.
The text was updated successfully, but these errors were encountered: