Skip to content

Backport PR #29057 on branch 0.25.x (CI: xfail on numpy 1.18) #29059

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions ci/build38.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ pip install --no-deps -U pip wheel setuptools
pip install python-dateutil pytz cython pytest pytest-xdist hypothesis

# Possible alternative for getting numpy:
# pip install --pre -f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com/ numpy
git clone https://github.com/numpy/numpy
cd numpy
python setup.py build_ext --inplace
python setup.py install
cd ..
rm -rf numpy
pip install --pre -f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com/ numpy

python setup.py build_ext -inplace
python -m pip install --no-build-isolation -e .
Expand Down
1 change: 1 addition & 0 deletions pandas/compat/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
_np_version_under1p15 = _nlv < LooseVersion("1.15")
_np_version_under1p16 = _nlv < LooseVersion("1.16")
_np_version_under1p17 = _nlv < LooseVersion("1.17")
_np_version_under1p18 = _nlv < LooseVersion("1.18")
_is_numpy_dev = ".dev" in str(_nlv)


Expand Down
13 changes: 13 additions & 0 deletions pandas/tests/series/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from numpy import nan
import pytest

from pandas.compat.numpy import _np_version_under1p18
import pandas.util._test_decorators as td

import pandas as pd
Expand Down Expand Up @@ -160,6 +161,9 @@ def test_cummax(self, datetime_series):

tm.assert_series_equal(result, expected)

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

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

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

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

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

Expand Down