Skip to content

Commit aec6293

Browse files
meeseeksmachinelithomas1simonjayhawkins
authored
Backport PR #42524: CI: Xfail less on Python 3.10 (#42525)
Co-authored-by: Thomas Li <[email protected]> Co-authored-by: Simon Hawkins <[email protected]>
1 parent ee401e6 commit aec6293

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

pandas/tests/indexes/test_base.py

-19
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
from pandas.compat import (
1414
IS64,
15-
PY310,
1615
np_datetime64_compat,
1716
)
1817
from pandas.util._test_decorators import async_mark
@@ -1004,24 +1003,6 @@ def test_isin_nan_common_object(self, request, nulls_fixture, nulls_fixture2):
10041003
and math.isnan(nulls_fixture)
10051004
and math.isnan(nulls_fixture2)
10061005
):
1007-
if PY310:
1008-
if (
1009-
# Failing cases are
1010-
# np.nan, float('nan')
1011-
# float('nan'), np.nan
1012-
# float('nan'), float('nan')
1013-
# Since only float('nan'), np.nan is float
1014-
# Use not np.nan to identify float('nan')
1015-
nulls_fixture is np.nan
1016-
and nulls_fixture2 is not np.nan
1017-
or nulls_fixture is not np.nan
1018-
):
1019-
request.applymarker(
1020-
# This test is flaky :(
1021-
pytest.mark.xfail(
1022-
reason="Failing on Python 3.10 GH41940", strict=False
1023-
)
1024-
)
10251006
tm.assert_numpy_array_equal(
10261007
Index(["a", nulls_fixture]).isin([nulls_fixture2]),
10271008
np.array([False, True]),

pandas/tests/reshape/test_get_dummies.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 PY310
7-
86
from pandas.core.dtypes.common import is_integer_dtype
97

108
import pandas as pd
@@ -430,8 +428,6 @@ def test_dataframe_dummies_unicode(self, get_dummies_kwargs, expected):
430428
result = get_dummies(**get_dummies_kwargs)
431429
tm.assert_frame_equal(result, expected)
432430

433-
# This is flaky on Python 3.10
434-
@pytest.mark.xfail(PY310, reason="Failing on Python 3.10 GH41940", strict=False)
435431
def test_get_dummies_basic_drop_first(self, sparse):
436432
# GH12402 Add a new parameter `drop_first` to avoid collinearity
437433
# Basic case
@@ -471,7 +467,6 @@ def test_get_dummies_basic_drop_first_one_level(self, sparse):
471467
result = get_dummies(s_series_index, drop_first=True, sparse=sparse)
472468
tm.assert_frame_equal(result, expected)
473469

474-
@pytest.mark.xfail(PY310, reason="Failing on Python 3.10 GH41940", strict=False)
475470
def test_get_dummies_basic_drop_first_NA(self, sparse):
476471
# Test NA handling together with drop_first
477472
s_NA = ["a", "b", np.nan]

pandas/tests/test_algos.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
algos as libalgos,
1010
hashtable as ht,
1111
)
12-
from pandas.compat import (
13-
PY310,
14-
np_array_datetime64_compat,
15-
)
12+
from pandas.compat import np_array_datetime64_compat
1613
import pandas.util._test_decorators as td
1714

1815
from pandas.core.dtypes.common import (
@@ -786,8 +783,6 @@ def test_different_nans(self):
786783
expected = np.array([np.nan])
787784
tm.assert_numpy_array_equal(result, expected)
788785

789-
# Flaky on Python 3.10 -> Don't make strict
790-
@pytest.mark.xfail(PY310, reason="Failing on Python 3.10 GH41940", strict=False)
791786
def test_first_nan_kept(self):
792787
# GH 22295
793788
# create different nans from bit-patterns:
@@ -993,8 +988,6 @@ def __hash__(self):
993988
# different objects -> False
994989
tm.assert_numpy_array_equal(algos.isin([a], [b]), np.array([False]))
995990

996-
# Flaky on Python 3.10 -> Don't make strict
997-
@pytest.mark.xfail(PY310, reason="Failing on Python 3.10 GH41940", strict=False)
998991
def test_different_nans(self):
999992
# GH 22160
1000993
# all nans are handled as equivalent
@@ -1037,8 +1030,6 @@ def test_empty(self, empty):
10371030
result = algos.isin(vals, empty)
10381031
tm.assert_numpy_array_equal(expected, result)
10391032

1040-
# Flaky on Python 3.10 -> Don't make strict
1041-
@pytest.mark.xfail(PY310, reason="Failing on Python 3.10 GH41940", strict=False)
10421033
def test_different_nan_objects(self):
10431034
# GH 22119
10441035
comps = np.array(["nan", np.nan * 1j, float("nan")], dtype=object)

0 commit comments

Comments
 (0)