Skip to content

Commit 76e312e

Browse files
jbrockmendelproost
authored andcommitted
CI: xfail on numpy 1.18 (pandas-dev#29057)
* xfail on numpy 1.18 * CI: try using numpy wheel
1 parent 148ee3a commit 76e312e

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

ci/build38.sh

+1-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ pip install --no-deps -U pip wheel setuptools
66
pip install python-dateutil pytz cython pytest pytest-xdist hypothesis
77

88
# Possible alternative for getting numpy:
9-
# pip install --pre -f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com/ numpy
10-
git clone https://github.com/numpy/numpy
11-
cd numpy
12-
python setup.py build_ext --inplace
13-
python setup.py install
14-
cd ..
15-
rm -rf numpy
9+
pip install --pre -f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com/ numpy
1610

1711
python setup.py build_ext -inplace
1812
python -m pip install --no-build-isolation -e .

pandas/compat/numpy/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
_np_version_under1p15 = _nlv < LooseVersion("1.15")
1313
_np_version_under1p16 = _nlv < LooseVersion("1.16")
1414
_np_version_under1p17 = _nlv < LooseVersion("1.17")
15+
_np_version_under1p18 = _nlv < LooseVersion("1.18")
1516
_is_numpy_dev = ".dev" in str(_nlv)
1617

1718

pandas/tests/series/test_analytics.py

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import numpy as np
55
import pytest
66

7+
from pandas.compat.numpy import _np_version_under1p18
78
import pandas.util._test_decorators as td
89

910
import pandas as pd
@@ -160,6 +161,9 @@ def test_cummax(self, datetime_series):
160161

161162
tm.assert_series_equal(result, expected)
162163

164+
@pytest.mark.xfail(
165+
not _np_version_under1p18, reason="numpy 1.18 changed min/max behavior for NaT"
166+
)
163167
def test_cummin_datetime64(self):
164168
s = pd.Series(
165169
pd.to_datetime(["NaT", "2000-1-2", "NaT", "2000-1-1", "NaT", "2000-1-3"])
@@ -179,6 +183,9 @@ def test_cummin_datetime64(self):
179183
result = s.cummin(skipna=False)
180184
tm.assert_series_equal(expected, result)
181185

186+
@pytest.mark.xfail(
187+
not _np_version_under1p18, reason="numpy 1.18 changed min/max behavior for NaT"
188+
)
182189
def test_cummax_datetime64(self):
183190
s = pd.Series(
184191
pd.to_datetime(["NaT", "2000-1-2", "NaT", "2000-1-1", "NaT", "2000-1-3"])
@@ -198,6 +205,9 @@ def test_cummax_datetime64(self):
198205
result = s.cummax(skipna=False)
199206
tm.assert_series_equal(expected, result)
200207

208+
@pytest.mark.xfail(
209+
not _np_version_under1p18, reason="numpy 1.18 changed min/max behavior for NaT"
210+
)
201211
def test_cummin_timedelta64(self):
202212
s = pd.Series(pd.to_timedelta(["NaT", "2 min", "NaT", "1 min", "NaT", "3 min"]))
203213

@@ -213,6 +223,9 @@ def test_cummin_timedelta64(self):
213223
result = s.cummin(skipna=False)
214224
tm.assert_series_equal(expected, result)
215225

226+
@pytest.mark.xfail(
227+
not _np_version_under1p18, reason="numpy 1.18 changed min/max behavior for NaT"
228+
)
216229
def test_cummax_timedelta64(self):
217230
s = pd.Series(pd.to_timedelta(["NaT", "2 min", "NaT", "1 min", "NaT", "3 min"]))
218231

0 commit comments

Comments
 (0)