Skip to content

Commit 61464f8

Browse files
authored
DEPS: drop np19 support (#47796)
1 parent 91d4cc5 commit 61464f8

File tree

17 files changed

+39
-83
lines changed

17 files changed

+39
-83
lines changed

.github/workflows/sdist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ jobs:
7979
run: |
8080
case "${{matrix.python-version}}" in
8181
3.8)
82-
pip install numpy==1.19.5 ;;
82+
pip install numpy==1.20.3 ;;
8383
3.9)
84-
pip install numpy==1.19.5 ;;
84+
pip install numpy==1.20.3 ;;
8585
3.10)
8686
pip install numpy==1.21.2 ;;
8787
esac

ci/deps/actions-38-minimum_versions.yaml

Lines changed: 1 addition & 1 deletion
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.19.5
20+
- numpy=1.20.3
2121
- pytz=2020.1
2222

2323
# optional dependencies

doc/source/getting_started/install.rst

Lines changed: 1 addition & 1 deletion
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.19.5
238+
`NumPy <https://numpy.org>`__ 1.20.3
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ If installed, we now require:
416416
+-----------------+-----------------+----------+---------+
417417
| Package | Minimum Version | Required | Changed |
418418
+=================+=================+==========+=========+
419-
| numpy | 1.19.5 | X | X |
419+
| numpy | 1.20.3 | X | X |
420420
+-----------------+-----------------+----------+---------+
421421
| mypy (dev) | 0.971 | | X |
422422
+-----------------+-----------------+----------+---------+

pandas/compat/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pandas._typing import F
1818
from pandas.compat.numpy import (
1919
is_numpy_dev,
20-
np_version_under1p20,
20+
np_version_under1p21,
2121
)
2222
from pandas.compat.pyarrow import (
2323
pa_version_under1p01,
@@ -152,7 +152,7 @@ def get_lzma_file() -> type[lzma.LZMAFile]:
152152

153153
__all__ = [
154154
"is_numpy_dev",
155-
"np_version_under1p20",
155+
"np_version_under1p21",
156156
"pa_version_under1p01",
157157
"pa_version_under2p0",
158158
"pa_version_under3p0",

pandas/compat/numpy/__init__.py

Lines changed: 2 additions & 3 deletions
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_under1p20 = _nlv < Version("1.20")
9+
np_version_under1p21 = _nlv < Version("1.21")
1010
np_version_under1p22 = _nlv < Version("1.22")
1111
np_version_gte1p22 = _nlv >= Version("1.22")
1212
is_numpy_dev = _nlv.dev is not None
13-
_min_numpy_ver = "1.19.5"
14-
is_numpy_min = _nlv == Version(_min_numpy_ver)
13+
_min_numpy_ver = "1.20.3"
1514

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

pandas/core/array_algos/putmask.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
ArrayLike,
1313
npt,
1414
)
15-
from pandas.compat import np_version_under1p20
15+
from pandas.compat import np_version_under1p21
1616

1717
from pandas.core.dtypes.cast import infer_dtype_from
1818
from pandas.core.dtypes.common import is_list_like
@@ -66,7 +66,7 @@ def putmask_without_repeat(
6666
mask : np.ndarray[bool]
6767
new : Any
6868
"""
69-
if np_version_under1p20:
69+
if np_version_under1p21:
7070
new = setitem_datetimelike_compat(values, mask.sum(), new)
7171

7272
if getattr(new, "ndim", 0) >= 1:
@@ -78,7 +78,6 @@ def putmask_without_repeat(
7878
shape = np.shape(new)
7979
# np.shape compat for if setitem_datetimelike_compat
8080
# changed arraylike to list e.g. test_where_dt64_2d
81-
8281
if nlocs == shape[-1]:
8382
# GH#30567
8483
# If length of ``new`` is less than the length of ``values``,

pandas/tests/arrays/floating/test_construction.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
from pandas.compat import np_version_under1p20
5-
64
import pandas as pd
75
import pandas._testing as tm
86
from pandas.core.arrays import FloatingArray
@@ -54,11 +52,6 @@ def test_floating_array_disallows_float16():
5452

5553
def test_floating_array_disallows_Float16_dtype(request):
5654
# GH#44715
57-
if np_version_under1p20:
58-
# https://github.com/numpy/numpy/issues/20512
59-
mark = pytest.mark.xfail(reason="numpy does not raise on np.dtype('Float16')")
60-
request.node.add_marker(mark)
61-
6255
with pytest.raises(TypeError, match="data type 'Float16' not understood"):
6356
pd.array([1.0, 2.0], dtype="Float16")
6457

pandas/tests/arrays/sparse/test_arithmetics.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
import numpy as np
44
import pytest
55

6-
from pandas.compat import np_version_under1p20
7-
86
import pandas as pd
97
import pandas._testing as tm
10-
from pandas.core import ops
118
from pandas.core.arrays.sparse import (
129
SparseArray,
1310
SparseDtype,
@@ -121,19 +118,7 @@ def test_float_scalar(
121118
self, kind, mix, all_arithmetic_functions, fill_value, scalar, request
122119
):
123120
op = all_arithmetic_functions
124-
125-
if np_version_under1p20:
126-
if op in [operator.floordiv, ops.rfloordiv]:
127-
if op is operator.floordiv and scalar != 0:
128-
pass
129-
elif op is ops.rfloordiv and scalar == 0:
130-
pass
131-
else:
132-
mark = pytest.mark.xfail(raises=AssertionError, reason="GH#38172")
133-
request.node.add_marker(mark)
134-
135121
values = np.array([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan])
136-
137122
a = SparseArray(values, kind=kind, fill_value=fill_value)
138123
self._check_numeric_ops(a, scalar, values, scalar, mix, op)
139124

@@ -171,14 +156,6 @@ def test_float_same_index_with_nans(
171156
):
172157
# when sp_index are the same
173158
op = all_arithmetic_functions
174-
175-
if (
176-
np_version_under1p20
177-
and op is ops.rfloordiv
178-
and not (mix and kind == "block")
179-
):
180-
mark = pytest.mark.xfail(raises=AssertionError, reason="GH#38172")
181-
request.node.add_marker(mark)
182159
values = np.array([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan])
183160
rvalues = np.array([np.nan, 2, 3, 4, np.nan, 0, 1, 3, 2, np.nan])
184161

@@ -353,13 +330,7 @@ def test_bool_array_logical(self, kind, fill_value):
353330

354331
def test_mixed_array_float_int(self, kind, mix, all_arithmetic_functions, request):
355332
op = all_arithmetic_functions
356-
357-
if np_version_under1p20 and op in [operator.floordiv, ops.rfloordiv] and mix:
358-
mark = pytest.mark.xfail(raises=AssertionError, reason="GH#38172")
359-
request.node.add_marker(mark)
360-
361333
rdtype = "int64"
362-
363334
values = np.array([np.nan, 1, 2, 0, np.nan, 0, 1, 2, 1, np.nan])
364335
rvalues = np.array([2, 0, 2, 3, 0, 0, 1, 5, 2, 0], dtype=rdtype)
365336

pandas/tests/extension/base/casting.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import pytest
33

4-
from pandas.compat import np_version_under1p20
4+
from pandas.compat import np_version_under1p21
55
import pandas.util._test_decorators as td
66

77
import pandas as pd
@@ -32,8 +32,7 @@ def test_astype_object_frame(self, all_data):
3232
assert result._mgr.arrays[0].dtype == np.dtype(object)
3333

3434
# earlier numpy raises TypeError on e.g. np.dtype(np.int64) == "Int64"
35-
# instead of returning False
36-
if not np_version_under1p20:
35+
if not np_version_under1p21:
3736
# check that we can compare the dtypes
3837
comp = result.dtypes == df.dtypes
3938
assert not comp.any()

0 commit comments

Comments
 (0)