Skip to content

Commit f0b1316

Browse files
authored
Revert "CI: Skip numpy dev failing tests (#39090)" (#39225)
This reverts commit 3bd3d1e
1 parent c5b4272 commit f0b1316

31 files changed

+5
-107
lines changed

pandas/compat/__init__.py

-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import warnings
1313

1414
from pandas._typing import F
15-
from pandas.compat.numpy import is_numpy_dev
1615

1716
PY38 = sys.version_info >= (3, 8)
1817
PY39 = sys.version_info >= (3, 9)
@@ -119,8 +118,3 @@ def get_lzma_file(lzma):
119118
"might be required to solve this issue."
120119
)
121120
return lzma.LZMAFile
122-
123-
124-
__all__ = [
125-
"is_numpy_dev",
126-
]

pandas/tests/arithmetic/test_interval.py

-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import numpy as np
44
import pytest
55

6-
from pandas.compat import is_numpy_dev
7-
86
from pandas.core.dtypes.common import is_list_like
97

108
import pandas as pd
@@ -254,7 +252,6 @@ def test_compare_length_mismatch_errors(self, op, other_constructor, length):
254252
with pytest.raises(ValueError, match="Lengths must match to compare"):
255253
op(array, other)
256254

257-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
258255
@pytest.mark.parametrize(
259256
"constructor, expected_type, assert_func",
260257
[

pandas/tests/base/test_misc.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import numpy as np
44
import pytest
55

6-
from pandas.compat import IS64, PYPY, is_numpy_dev
6+
from pandas.compat import IS64, PYPY
77

88
from pandas.core.dtypes.common import is_categorical_dtype, is_object_dtype
99

@@ -116,9 +116,6 @@ def test_searchsorted(index_or_series_obj):
116116
# See gh-14833
117117
pytest.skip("np.searchsorted doesn't work on pd.MultiIndex")
118118

119-
if is_object_dtype(obj) and is_numpy_dev:
120-
pytest.skip("GH#39089 Numpy changed dtype inference")
121-
122119
max_obj = max(obj, default=0)
123120
index = np.searchsorted(obj, max_obj)
124121
assert 0 <= index <= len(obj)

pandas/tests/extension/base/methods.py

-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import numpy as np
44
import pytest
55

6-
from pandas.compat import is_numpy_dev
7-
86
from pandas.core.dtypes.common import is_bool_dtype
97

108
import pandas as pd
@@ -394,9 +392,6 @@ def test_hash_pandas_object_works(self, data, as_frame):
394392
b = pd.util.hash_pandas_object(data)
395393
self.assert_equal(a, b)
396394

397-
@pytest.mark.xfail(
398-
is_numpy_dev, reason="GH#39089 Numpy changed dtype inference", strict=False
399-
)
400395
def test_searchsorted(self, data_for_sorting, as_series):
401396
b, c, a = data_for_sorting
402397
arr = data_for_sorting.take([2, 0, 1]) # to get [a, b, c]

pandas/tests/frame/apply/test_frame_apply.py

-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import numpy as np
66
import pytest
77

8-
from pandas.compat import is_numpy_dev
9-
108
from pandas.core.dtypes.dtypes import CategoricalDtype
119

1210
import pandas as pd
@@ -592,7 +590,6 @@ def test_apply_dict(self):
592590
tm.assert_frame_equal(reduce_false, df)
593591
tm.assert_series_equal(reduce_none, dicts)
594592

595-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
596593
def test_applymap(self, float_frame):
597594
applied = float_frame.applymap(lambda x: x * 2)
598595
tm.assert_frame_equal(applied, float_frame * 2)

pandas/tests/frame/indexing/test_indexing.py

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import pytest
66

77
from pandas._libs import iNaT
8-
from pandas.compat import is_numpy_dev
98

109
from pandas.core.dtypes.common import is_integer
1110

@@ -255,8 +254,6 @@ def inc(x):
255254
)
256255
def test_setitem_same_column(self, cols, values, expected):
257256
# GH 23239
258-
if cols == ["C", "D", "D", "a"] and is_numpy_dev:
259-
pytest.skip("GH#39089 Numpy changed dtype inference")
260257
df = DataFrame([values], columns=cols)
261258
df["a"] = df["a"]
262259
result = df["a"].values[0]

pandas/tests/frame/methods/test_drop.py

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import numpy as np
44
import pytest
55

6-
from pandas.compat import is_numpy_dev
76
from pandas.errors import PerformanceWarning
87
import pandas.util._test_decorators as td
98

@@ -109,7 +108,6 @@ def test_drop_names(self):
109108
expected = Index(["a", "b", "c"], name="first")
110109
tm.assert_index_equal(dropped.index, expected)
111110

112-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
113111
def test_drop(self):
114112
simple = DataFrame({"A": [1, 2, 3, 4], "B": [0, 1, 2, 3]})
115113
tm.assert_frame_equal(simple.drop("A", axis=1), simple[["B"]])

pandas/tests/frame/methods/test_isin.py

-3
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 is_numpy_dev
5-
64
import pandas as pd
75
from pandas import DataFrame, MultiIndex, Series
86
import pandas._testing as tm
@@ -34,7 +32,6 @@ def test_isin_empty(self, empty):
3432
result = df.isin(empty)
3533
tm.assert_frame_equal(result, expected)
3634

37-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
3835
def test_isin_dict(self):
3936
df = DataFrame({"A": ["a", "b", "c"], "B": ["a", "e", "f"]})
4037
d = {"A": ["a"]}

pandas/tests/frame/methods/test_replace.py

-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import numpy as np
77
import pytest
88

9-
from pandas.compat import is_numpy_dev
10-
119
import pandas as pd
1210
from pandas import DataFrame, Index, Series, Timestamp, date_range
1311
import pandas._testing as tm
@@ -1510,7 +1508,6 @@ def test_replace_no_replacement_dtypes(self, dtype, value):
15101508
result = df.replace(to_replace=[None, -np.inf, np.inf], value=value)
15111509
tm.assert_frame_equal(result, df)
15121510

1513-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
15141511
@pytest.mark.parametrize("replacement", [np.nan, 5])
15151512
def test_replace_with_duplicate_columns(self, replacement):
15161513
# GH 24798

pandas/tests/frame/methods/test_to_csv.py

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import numpy as np
66
import pytest
77

8-
from pandas.compat import is_numpy_dev
98
from pandas.errors import ParserError
109

1110
import pandas as pd
@@ -182,7 +181,6 @@ def test_to_csv_cols_reordering(self):
182181

183182
tm.assert_frame_equal(df[cols], rs_c, check_names=False)
184183

185-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
186184
def test_to_csv_new_dupe_cols(self):
187185
import pandas as pd
188186

pandas/tests/frame/test_nonunique_indexes.py

-5
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 is_numpy_dev
5-
64
import pandas as pd
75
from pandas import DataFrame, MultiIndex, Series, date_range
86
import pandas._testing as tm
@@ -16,7 +14,6 @@ def check(result, expected=None):
1614

1715

1816
class TestDataFrameNonuniqueIndexes:
19-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
2017
def test_column_dups_operations(self):
2118

2219
# assignment
@@ -313,7 +310,6 @@ def test_column_dups2(self):
313310
result = df.dropna(subset=["A", "C"], how="all")
314311
tm.assert_frame_equal(result, expected)
315312

316-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
317313
def test_getitem_boolean_series_with_duplicate_columns(self):
318314
# boolean indexing
319315
# GH 4879
@@ -341,7 +337,6 @@ def test_getitem_boolean_frame_with_duplicate_columns(self):
341337
result = df[df > 6]
342338
check(result, expected)
343339

344-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
345340
def test_getitem_boolean_frame_unaligned_with_duplicate_columns(self):
346341
# `df.A > 6` is a DataFrame with a different shape from df
347342
dups = ["A", "A", "C", "D"]

pandas/tests/groupby/test_function.py

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

7-
from pandas.compat import is_numpy_dev
87
from pandas.errors import UnsupportedFunctionCall
98

109
import pandas as pd
@@ -1005,7 +1004,6 @@ def test_frame_describe_unstacked_format():
10051004
tm.assert_frame_equal(result, expected)
10061005

10071006

1008-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
10091007
@pytest.mark.filterwarnings(
10101008
"ignore:"
10111009
"indexing past lexsort depth may impact performance:"

pandas/tests/groupby/test_quantile.py

-7
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 is_numpy_dev
5-
64
import pandas as pd
75
from pandas import DataFrame, Index
86
import pandas._testing as tm
@@ -73,7 +71,6 @@ def test_quantile_array():
7371
tm.assert_frame_equal(result, expected)
7472

7573

76-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
7774
def test_quantile_array2():
7875
# https://github.com/pandas-dev/pandas/pull/28085#issuecomment-524066959
7976
df = DataFrame(
@@ -109,7 +106,6 @@ def test_quantile_array_no_sort():
109106
tm.assert_frame_equal(result, expected)
110107

111108

112-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
113109
def test_quantile_array_multiple_levels():
114110
df = DataFrame(
115111
{"A": [0, 1, 2], "B": [3, 4, 5], "c": ["a", "a", "a"], "d": ["a", "a", "b"]}
@@ -220,8 +216,6 @@ def test_quantile_missing_group_values_correct_results(
220216
@pytest.mark.parametrize("q", [0.5, [0.0, 0.5, 1.0]])
221217
def test_groupby_quantile_nullable_array(values, q):
222218
# https://github.com/pandas-dev/pandas/issues/33136
223-
if isinstance(q, list):
224-
pytest.skip("GH#39089 Numpy changed dtype inference")
225219
df = DataFrame({"a": ["x"] * 3 + ["y"] * 3, "b": values})
226220
result = df.groupby("a")["b"].quantile(q)
227221

@@ -262,7 +256,6 @@ def test_groupby_timedelta_quantile():
262256
tm.assert_frame_equal(result, expected)
263257

264258

265-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
266259
def test_columns_groupby_quantile():
267260
# GH 33795
268261
df = DataFrame(

pandas/tests/indexes/base_class/test_indexing.py

-3
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 is_numpy_dev
5-
64
from pandas import Index
75
import pandas._testing as tm
86

@@ -15,7 +13,6 @@ def test_get_slice_bounds_within(self, kind, side, expected):
1513
result = index.get_slice_bound("e", kind=kind, side=side)
1614
assert result == expected
1715

18-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
1916
@pytest.mark.parametrize("kind", ["getitem", "loc", None])
2017
@pytest.mark.parametrize("side", ["left", "right"])
2118
@pytest.mark.parametrize(

pandas/tests/indexes/base_class/test_where.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import numpy as np
2-
import pytest
3-
4-
from pandas.compat import is_numpy_dev
52

63
from pandas import Index
74
import pandas._testing as tm
85

96

107
class TestWhere:
11-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
128
def test_where_intlike_str_doesnt_cast_ints(self):
139
idx = Index(range(3))
1410
mask = np.array([True, False, True])

pandas/tests/indexes/categorical/test_indexing.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
from pandas.compat import is_numpy_dev
54
from pandas.errors import InvalidIndexError
65

76
import pandas as pd
@@ -130,7 +129,6 @@ def test_take_invalid_kwargs(self):
130129

131130

132131
class TestGetLoc:
133-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
134132
def test_get_loc(self):
135133
# GH 12531
136134
cidx1 = CategoricalIndex(list("abcde"), categories=list("edabc"))

pandas/tests/indexes/interval/test_interval.py

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

7-
from pandas.compat import is_numpy_dev
87
from pandas.errors import InvalidIndexError
98

109
import pandas as pd
@@ -917,9 +916,6 @@ def test_searchsorted_different_argument_classes(klass):
917916
tm.assert_numpy_array_equal(result, expected)
918917

919918

920-
@pytest.mark.xfail(
921-
is_numpy_dev, reason="GH#39089 Numpy changed dtype inference", strict=False
922-
)
923919
@pytest.mark.parametrize(
924920
"arg", [[1, 2], ["a", "b"], [Timestamp("2020-01-01", tz="Europe/London")] * 2]
925921
)

pandas/tests/indexes/period/test_constructors.py

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import pytest
33

44
from pandas._libs.tslibs.period import IncompatibleFrequency
5-
from pandas.compat import is_numpy_dev
65

76
from pandas.core.dtypes.dtypes import PeriodDtype
87

@@ -305,7 +304,6 @@ def test_constructor_incompat_freq(self):
305304
)
306305
)
307306

308-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
309307
def test_constructor_mixed(self):
310308
idx = PeriodIndex(["2011-01", NaT, Period("2011-01", freq="M")])
311309
exp = PeriodIndex(["2011-01", "NaT", "2011-01"], freq="M")

pandas/tests/indexes/test_base.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010

1111
from pandas._libs.tslib import Timestamp
12-
from pandas.compat import IS64, is_numpy_dev
12+
from pandas.compat import IS64
1313
from pandas.compat.numpy import np_datetime64_compat
1414
from pandas.util._test_decorators import async_mark
1515

@@ -1358,7 +1358,6 @@ def test_slice_float_locs(self, dtype):
13581358
assert index2.slice_locs(8.5, 1.5) == (2, 6)
13591359
assert index2.slice_locs(10.5, -1) == (0, n)
13601360

1361-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
13621361
def test_slice_locs_dup(self):
13631362
index = Index(["a", "a", "b", "c", "d", "d"])
13641363
assert index.slice_locs("a", "d") == (0, 6)
@@ -1398,9 +1397,6 @@ def test_slice_locs_na_raises(self):
13981397
with pytest.raises(KeyError, match=""):
13991398
index.slice_locs(end=1.5)
14001399

1401-
@pytest.mark.xfail(
1402-
is_numpy_dev, reason="GH#39089 Numpy changed dtype inference", strict=False
1403-
)
14041400
@pytest.mark.parametrize(
14051401
"in_slice,expected",
14061402
[

pandas/tests/indexes/test_engines.py

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pytest
55

66
from pandas._libs import algos as libalgos, index as libindex
7-
from pandas.compat import is_numpy_dev
87

98
import pandas as pd
109
import pandas._testing as tm
@@ -199,7 +198,6 @@ def test_is_unique(self):
199198
engine = self.engine_type(lambda: arr, len(arr))
200199
assert engine.is_unique is False
201200

202-
@pytest.mark.xfail(is_numpy_dev, reason="GH#39089 Numpy changed dtype inference")
203201
def test_get_loc(self):
204202
# unique
205203
arr = np.array(self.values, dtype=self.dtype)

0 commit comments

Comments
 (0)