I found the upstream commit that added compatibility with dateutil >
2.6.0.
Their first patch for fixing a timezone test checked for dateutils
version equality.
The commit I found used a test for greater than or equal to 2.6.0
Diane
From b551f07c7c15a3e166fe10629c620c0520eb5892 Mon Sep 17 00:00:00 2001
From: Diane Trout <[email protected]>
Date: Wed, 20 Sep 2017 23:33:17 -0700
Subject: [PATCH 4/4] Add dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch
(Closes: #875807)
---
debian/changelog | 1 +
.../dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch | 116 +++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 118 insertions(+)
create mode 100644 debian/patches/dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch
diff --git a/debian/changelog b/debian/changelog
index 7b2532bad..f3c221232 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ pandas (0.20.3-2) unstable; urgency=medium
* Update to debhelper 10
* Use Python 3 versions of -sphinx and -nbsphinx
* Support nocheck and nodoc build profiles (Closes: #875805)
+ * Add dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch (Closes: #875807)
-- Diane Trout <[email protected]> Wed, 13 Sep 2017 16:36:13 -0700
diff --git a/debian/patches/dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch b/debian/patches/dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch
new file mode 100644
index 000000000..d9deef16f
--- /dev/null
+++ b/debian/patches/dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch
@@ -0,0 +1,116 @@
+From 55af1ab626baf62dbbc00c2521c20be29b819a06 Mon Sep 17 00:00:00 2001
+From: Jeff Reback <[email protected]>
+Date: Tue, 11 Jul 2017 12:39:39 -0400
+Subject: [PATCH] COMPAT with dateutil 2.6.1, fixed ambiguous tz dst behavior
+ (#16880)
+ Needed after dateutil 2.6.0
+Origin: https://github.com/pandas-dev/pandas/commit/55af1ab626baf62dbbc00c2521c20be29b819a06
+Bug: https://github.com/pandas-dev/pandas/issues/17533
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=875807
+
+---
+ ci/requirements-3.5.run | 1 -
+ ci/requirements-3.5.sh | 4 ++++
+ ci/requirements-3.6_NUMPY_DEV.run | 1 -
+ pandas/tests/tseries/test_offsets.py | 5 ++++-
+ pandas/tests/tseries/test_timezones.py | 21 +++++++++++++++++----
+ 5 files changed, 25 insertions(+), 7 deletions(-)
+
+diff --git a/ci/requirements-3.5.run b/ci/requirements-3.5.run
+index 43e6814ed..52828b522 100644
+--- a/ci/requirements-3.5.run
++++ b/ci/requirements-3.5.run
+@@ -1,4 +1,3 @@
+-python-dateutil
+ pytz
+ numpy=1.11.3
+ openpyxl
+diff --git a/ci/requirements-3.5.sh b/ci/requirements-3.5.sh
+index d0f0b8180..917439a87 100644
+--- a/ci/requirements-3.5.sh
++++ b/ci/requirements-3.5.sh
+@@ -5,3 +5,7 @@ source activate pandas
+ echo "install 35"
+
+ conda install -n pandas -c conda-forge feather-format
++
++# pip install python-dateutil to get latest
++conda remove -n pandas python-dateutil --force
++pip install python-dateutil
+diff --git a/ci/requirements-3.6_NUMPY_DEV.run b/ci/requirements-3.6_NUMPY_DEV.run
+index 0aa987bae..af44f198c 100644
+--- a/ci/requirements-3.6_NUMPY_DEV.run
++++ b/ci/requirements-3.6_NUMPY_DEV.run
+@@ -1,2 +1 @@
+-python-dateutil
+ pytz
+diff --git a/pandas/tests/tseries/test_offsets.py b/pandas/tests/tseries/test_offsets.py
+index 47b15a2b6..e03b3e0a8 100644
+--- a/pandas/tests/tseries/test_offsets.py
++++ b/pandas/tests/tseries/test_offsets.py
+@@ -4844,7 +4844,7 @@ class TestDST(object):
+ hrs_pre = utc_offsets['utc_offset_daylight']
+ hrs_post = utc_offsets['utc_offset_standard']
+
+- if dateutil.__version__ != LooseVersion('2.6.0'):
++ if dateutil.__version__ < LooseVersion('2.6.0'):
+ # buggy ambiguous behavior in 2.6.0
+ # GH 14621
+ # https://github.com/dateutil/dateutil/issues/321
+@@ -4852,6 +4852,9 @@ class TestDST(object):
+ n=3, tstart=self._make_timestamp(self.ts_pre_fallback,
+ hrs_pre, tz),
+ expected_utc_offset=hrs_post)
++ elif dateutil.__version__ > LooseVersion('2.6.0'):
++ # fixed, but skip the test
++ continue
+
+ def test_springforward_plural(self):
+ # test moving from standard to daylight savings
+diff --git a/pandas/tests/tseries/test_timezones.py b/pandas/tests/tseries/test_timezones.py
+index de6978d52..c034a9c60 100644
+--- a/pandas/tests/tseries/test_timezones.py
++++ b/pandas/tests/tseries/test_timezones.py
+@@ -552,8 +552,16 @@ class TestTimeZoneSupportPytz(object):
+ tz=tz, ambiguous='infer')
+ assert times[0] == Timestamp('2013-10-26 23:00', tz=tz, freq="H")
+
+- if dateutil.__version__ != LooseVersion('2.6.0'):
+- # see gh-14621
++ if str(tz).startswith('dateutil'):
++ if dateutil.__version__ < LooseVersion('2.6.0'):
++ # see gh-14621
++ assert times[-1] == Timestamp('2013-10-27 01:00:00+0000',
++ tz=tz, freq="H")
++ elif dateutil.__version__ > LooseVersion('2.6.0'):
++ # fixed ambiguous behavior
++ assert times[-1] == Timestamp('2013-10-27 01:00:00+0100',
++ tz=tz, freq="H")
++ else:
+ assert times[-1] == Timestamp('2013-10-27 01:00:00+0000',
+ tz=tz, freq="H")
+
+@@ -1233,13 +1241,18 @@ class TestTimeZones(object):
+ assert result_pytz.value == result_dateutil.value
+ assert result_pytz.value == 1382835600000000000
+
+- # dateutil 2.6 buggy w.r.t. ambiguous=0
+- if dateutil.__version__ != LooseVersion('2.6.0'):
++ if dateutil.__version__ < LooseVersion('2.6.0'):
++ # dateutil 2.6 buggy w.r.t. ambiguous=0
+ # see gh-14621
+ # see https://github.com/dateutil/dateutil/issues/321
+ assert (result_pytz.to_pydatetime().tzname() ==
+ result_dateutil.to_pydatetime().tzname())
+ assert str(result_pytz) == str(result_dateutil)
++ elif dateutil.__version__ > LooseVersion('2.6.0'):
++ # fixed ambiguous behavior
++ assert result_pytz.to_pydatetime().tzname() == 'GMT'
++ assert result_dateutil.to_pydatetime().tzname() == 'BST'
++ assert str(result_pytz) != str(result_dateutil)
+
+ # 1 hour difference
+ result_pytz = (Timestamp('2013-10-27 01:00:00')
+--
+2.13.2
+
diff --git a/debian/patches/series b/debian/patches/series
index 683e3e10d..763ab28d3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ deb_skip_sequencelike_on_armel
# 858260.patch
up_print_versions
up_network_seaborn
+dateutil-2.6.1-fixed-ambiguous-tz-dst-be.patch
--
2.14.1