Skip to content

Backport PR #35502 on branch 1.1.x (CI: xfail numpy-dev) #35537

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
12 changes: 11 additions & 1 deletion pandas/tests/indexes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import pytest

from pandas._libs import iNaT
from pandas.compat.numpy import _is_numpy_dev
from pandas.errors import InvalidIndexError

from pandas.core.dtypes.common import is_datetime64tz_dtype
Expand Down Expand Up @@ -417,7 +418,7 @@ def test_set_ops_error_cases(self, case, method, index):
with pytest.raises(TypeError, match=msg):
getattr(index, method)(case)

def test_intersection_base(self, index):
def test_intersection_base(self, index, request):
if isinstance(index, CategoricalIndex):
return

Expand All @@ -434,6 +435,15 @@ def test_intersection_base(self, index):
# GH 10149
cases = [klass(second.values) for klass in [np.array, Series, list]]
for case in cases:
# https://github.com/pandas-dev/pandas/issues/35481
if (
_is_numpy_dev
and isinstance(case, Series)
and isinstance(index, UInt64Index)
):
mark = pytest.mark.xfail(reason="gh-35481")
request.node.add_marker(mark)

result = first.intersection(case)
assert tm.equalContents(result, second)

Expand Down
3 changes: 3 additions & 0 deletions pandas/tests/indexing/test_loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import numpy as np
import pytest

from pandas.compat.numpy import _is_numpy_dev

import pandas as pd
from pandas import DataFrame, Series, Timestamp, date_range
import pandas._testing as tm
Expand Down Expand Up @@ -945,6 +947,7 @@ def test_loc_setitem_empty_append(self):
df.loc[0, "x"] = expected.loc[0, "x"]
tm.assert_frame_equal(df, expected)

@pytest.mark.xfail(_is_numpy_dev, reason="gh-35481")
def test_loc_setitem_empty_append_raises(self):
# GH6173, various appends to an empty dataframe

Expand Down