Skip to content

Commit 37468b5

Browse files
committed
test_empty_fancy passes
1 parent 5cb0c64 commit 37468b5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/tests/indexes/test_base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,13 @@ def test_empty_fancy(self, index, dtype, request, using_infer_string):
487487

488488
assert index[[]].identical(empty_index)
489489
if dtype == np.bool_:
490-
with pytest.raises(ValueError, match="length of the boolean indexer"):
490+
491+
if index.dtype.name == "string":
492+
# `string[python]` allows empty boolean indexing
491493
assert index[empty_arr].identical(empty_index)
494+
else:
495+
with pytest.raises(ValueError, match="length of the boolean indexer"):
496+
assert index[empty_arr].identical(empty_index)
492497
else:
493498
assert index[empty_arr].identical(empty_index)
494499

0 commit comments

Comments
 (0)