You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ENH: Use datetutil.tz.gettz() instead of dateutil.zoneinfo.gettz()
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 #9059
4 #8639
5 #10121
6 #9663
Signed-off-by: Justin Lecher <[email protected]>
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.17.0.txt
+21-2
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,26 @@ New features
26
26
Other enhancements
27
27
^^^^^^^^^^^^^^^^^^
28
28
29
+
- Add helper functions to check for OS running on
30
+
31
+
from pandas.compat import is_platform_windows
32
+
if is_platform_window():
33
+
pass
34
+
35
+
- Use dateutil.tz.gettz() after upstream recommandations
36
+
37
+
python-dateutil provides two implementations of gettz().
38
+
"dateutil.tz.gettz()" tries to load zone information from system provided data and fals back to
39
+
an included tarball, where as "dateutil.zoneinfo.gettz() loads directly from the tarball. Using the later on systems
40
+
which aren't providing included zone informations (e.g. Fedora or Gentoo) breaks (#9059, #8639, #9663 and #10121)
41
+
As stated by upstream in https://github.com/dateutil/dateutil/issues/11#issuecomment-70769019 only the former should be
42
+
used by library consumers.
43
+
44
+
For compatibility in pandas following code should be used
45
+
46
+
from pandas.tslib import _dateutil_gettz as gettz
47
+
tz = gettz('Europe/Brussels')
48
+
29
49
.. _whatsnew_0170.api:
30
50
31
51
Backwards incompatible API changes
@@ -66,5 +86,4 @@ Bug Fixes
66
86
- Bug in ``Timestamp``'s' ``microsecond``, ``quarter``, ``dayofyear``, ``week`` and ``daysinmonth`` properties return ``np.int`` type, not built-in ``int``. (:issue:`10050`)
67
87
- Bug in ``NaT`` raises ``AttributeError`` when accessing to ``daysinmonth``, ``dayofweek`` properties. (:issue:`10096`)
68
88
69
-
70
-
89
+
- Bug in dateutil.tz.gettz() vs. dateutil.zoneinfo.gettz() usage which creates problems on systems solely rely on systems timezone data (:issue:`9123`, :issue:`9059`, :issue:`8639`, :issue:`9663`, :issue:`10121`)
0 commit comments