Skip to content

Commit 2504717

Browse files
author
shdongre
committed
don't test searchSorted on mixed types
1 parent 77e46d3 commit 2504717

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pandas/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def _create_mi_with_dt64tz_level():
706706
"string-python": Index(
707707
pd.array([f"pandas_{i}" for i in range(10)], dtype="string[python]")
708708
),
709-
"mixed-int-string": Index([0, "a", 1, "b", 2, "c"], dtype="mixed-int-string"),
709+
"mixed-int-string": Index([0, "a", 1, "b", 2, "c"]),
710710
}
711711
if has_pyarrow:
712712
idx = Index(pd.array([f"pandas_{i}" for i in range(10)], dtype="string[pyarrow]"))

pandas/tests/base/test_misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ def test_searchsorted(request, index_or_series_obj):
160160
mark = pytest.mark.xfail(reason="complex objects are not comparable")
161161
request.applymarker(mark)
162162

163-
elif obj.dtype == "mixed-int-string" and isinstance(obj, Index):
164-
mark = pytest.mark.xfail(reason="np.searchsorted doesn't work on mixed types String and Int: mixed-int-string")
163+
elif set(type(x) for x in obj) > 1 and isinstance(obj, Index):
164+
mark = pytest.mark.xfail(reason="np.searchsorted doesn't work on mixed types")
165165
request.applymarker(mark)
166166

167167
max_obj = max(obj, default=0)

0 commit comments

Comments
 (0)