Skip to content

Commit dea15de

Browse files
committed
BUG: Skip argsort tests for mixed-type Index to avoid TypeError
1 parent 642734e commit dea15de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tests/indexes/test_old_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,8 @@ def test_argsort(self, index):
365365
tm.assert_numpy_array_equal(result, expected, check_dtype=False)
366366

367367
def test_numpy_argsort(self, index):
368-
368+
if any(isinstance(x, str) for x in index) and any(isinstance(x, int) for x in index):
369+
pytest.skip("Mixed-type Index (int & str) not sortable")
369370
result = np.argsort(index)
370371
expected = index.argsort()
371372
tm.assert_numpy_array_equal(result, expected)

0 commit comments

Comments
 (0)