Skip to content

Commit 07c46df

Browse files
authored
DEPS: drop np 18 supoort (#47226)
1 parent c5e32b5 commit 07c46df

File tree

10 files changed

+12
-38
lines changed

10 files changed

+12
-38
lines changed

ci/deps/actions-38-minimum_versions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717

1818
# required dependencies
1919
- python-dateutil=2.8.1
20-
- numpy=1.18.5
20+
- numpy=1.19.5
2121
- pytz=2020.1
2222

2323
# optional dependencies

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ Dependencies
235235
================================================================ ==========================
236236
Package Minimum supported version
237237
================================================================ ==========================
238-
`NumPy <https://numpy.org>`__ 1.18.5
238+
`NumPy <https://numpy.org>`__ 1.19.5
239239
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.8.1
240240
`pytz <https://pypi.org/project/pytz/>`__ 2020.1
241241
================================================================ ==========================

doc/source/whatsnew/v1.5.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ If installed, we now require:
362362
+-----------------+-----------------+----------+---------+
363363
| Package | Minimum Version | Required | Changed |
364364
+=================+=================+==========+=========+
365+
| numpy | 1.19.5 | X | X |
366+
+-----------------+-----------------+----------+---------+
365367
| mypy (dev) | 0.960 | | X |
366368
+-----------------+-----------------+----------+---------+
367369
| beautifulsoup4 | 4.9.3 | | X |

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- conda-forge
44
dependencies:
55
# required
6-
- numpy>=1.18.5
6+
- numpy>=1.19.5
77
- python=3.8
88
- python-dateutil>=2.8.1
99
- pytz

pandas/compat/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from pandas._typing import F
1515
from pandas.compat.numpy import (
1616
is_numpy_dev,
17-
np_version_under1p19,
1817
np_version_under1p20,
1918
)
2019
from pandas.compat.pyarrow import (
@@ -145,7 +144,6 @@ def get_lzma_file():
145144

146145
__all__ = [
147146
"is_numpy_dev",
148-
"np_version_under1p19",
149147
"np_version_under1p20",
150148
"pa_version_under1p01",
151149
"pa_version_under2p0",

pandas/compat/numpy/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
# numpy versioning
77
_np_version = np.__version__
88
_nlv = Version(_np_version)
9-
np_version_under1p19 = _nlv < Version("1.19")
109
np_version_under1p20 = _nlv < Version("1.20")
1110
np_version_under1p22 = _nlv < Version("1.22")
1211
np_version_gte1p22 = _nlv >= Version("1.22")
1312
is_numpy_dev = _nlv.dev is not None
14-
_min_numpy_ver = "1.18.5"
13+
_min_numpy_ver = "1.19.5"
1514

1615
if is_numpy_dev or not np_version_under1p22:
1716
np_percentile_argname = "method"

pandas/tests/frame/indexing/test_where.py

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

7-
from pandas.compat import np_version_under1p19
7+
from pandas.compat import np_version_under1p20
88

99
from pandas.core.dtypes.common import is_scalar
1010

@@ -918,13 +918,6 @@ def test_where_period_invalid_na(frame_or_series, as_cat, request):
918918
r"Cannot setitem on a Categorical with a new category \(NaT\), "
919919
"set the categories first"
920920
)
921-
if np_version_under1p19:
922-
mark = pytest.mark.xfail(
923-
reason="When evaluating the f-string to generate the exception "
924-
"message, numpy somehow ends up trying to cast None to int, so "
925-
"ends up raising TypeError but with an unrelated message."
926-
)
927-
request.node.add_marker(mark)
928921
else:
929922
msg = "value should be a 'Period'"
930923

@@ -1013,6 +1006,7 @@ def _check_where_equivalences(df, mask, other, expected):
10131006
tm.assert_frame_equal(df, expected)
10141007

10151008

1009+
@pytest.mark.xfail(np_version_under1p20, reason="failed on Numpy 1.19.5")
10161010
def test_where_dt64_2d():
10171011
dti = date_range("2016-01-01", periods=6)
10181012
dta = dti._data.reshape(3, 2)

pandas/tests/frame/test_constructors.py

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import pytest
1919
import pytz
2020

21-
from pandas.compat import np_version_under1p19
2221
import pandas.util._test_decorators as td
2322

2423
from pandas.core.dtypes.common import is_integer_dtype
@@ -308,7 +307,6 @@ def test_constructor_dtype_list_data(self):
308307
assert df.loc[1, 0] is None
309308
assert df.loc[0, 1] == "2"
310309

311-
@pytest.mark.skipif(np_version_under1p19, reason="NumPy change.")
312310
def test_constructor_list_of_2d_raises(self):
313311
# https://github.com/pandas-dev/pandas/issues/32289
314312
a = DataFrame()

pandas/tests/series/test_constructors.py

+3-20
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
iNaT,
1414
lib,
1515
)
16-
from pandas.compat.numpy import (
17-
np_version_under1p19,
18-
np_version_under1p20,
19-
)
16+
from pandas.compat.numpy import np_version_under1p20
2017
import pandas.util._test_decorators as td
2118

2219
from pandas.core.dtypes.common import (
@@ -818,18 +815,11 @@ def test_constructor_coerce_float_valid(self, float_numpy_dtype):
818815
expected = Series([1, 2, 3.5]).astype(float_numpy_dtype)
819816
tm.assert_series_equal(s, expected)
820817

821-
def test_constructor_invalid_coerce_ints_with_float_nan(
822-
self, any_int_numpy_dtype, request
823-
):
818+
def test_constructor_invalid_coerce_ints_with_float_nan(self, any_int_numpy_dtype):
824819
# GH 22585
825820
# Updated: make sure we treat this list the same as we would treat the
826-
# equivalent ndarray
827-
if np_version_under1p19 and np.dtype(any_int_numpy_dtype).kind == "u":
828-
mark = pytest.mark.xfail(reason="Produces an extra RuntimeWarning")
829-
request.node.add_marker(mark)
830-
821+
# equivalent ndarray
831822
vals = [1, 2, np.nan]
832-
833823
msg = "In a future version, passing float-dtype values containing NaN"
834824
with tm.assert_produces_warning(FutureWarning, match=msg):
835825
res = Series(vals, dtype=any_int_numpy_dtype)
@@ -1958,13 +1948,6 @@ def test_constructor(rand_series_with_duplicate_datetimeindex):
19581948
({1: 1}, np.array([[1]], dtype=np.int64)),
19591949
],
19601950
)
1961-
@pytest.mark.skipif(np_version_under1p19, reason="fails on numpy below 1.19")
19621951
def test_numpy_array(input_dict, expected):
19631952
result = np.array([Series(input_dict)])
19641953
tm.assert_numpy_array_equal(result, expected)
1965-
1966-
1967-
@pytest.mark.xfail(not np_version_under1p19, reason="check failure on numpy below 1.19")
1968-
def test_numpy_array_np_v1p19():
1969-
with pytest.raises(KeyError, match="0"):
1970-
np.array([Series({1: 1})])

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is auto-generated from environment.yml, do not modify.
22
# See that file for comments about the need/usage of each dependency.
33

4-
numpy>=1.18.5
4+
numpy>=1.19.5
55
python-dateutil>=2.8.1
66
pytz
77
asv

0 commit comments

Comments
 (0)