Skip to content

Commit d7b534e

Browse files
committed
BUG: Mark test_numpy_ufuncs_reductions as xfail for mixed int/str index
1 parent 33e2a34 commit d7b534e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/tests/indexes/test_numpy_compat.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ def test_numpy_ufuncs_reductions(index, func, request):
156156
if len(index) == 0:
157157
pytest.skip("Test doesn't make sense for empty index.")
158158

159+
if any(isinstance(x, str) for x in index) and any(isinstance(x, int) for x in index):
160+
request.applymarker(
161+
pytest.mark.xfail(reason="Cannot compare mixed types (int and str) in ufunc reductions")
162+
)
163+
159164
if isinstance(index, CategoricalIndex) and index.dtype.ordered is False:
160165
with pytest.raises(TypeError, match="is not ordered for"):
161166
func.reduce(index)

0 commit comments

Comments
 (0)