Skip to content

Commit 938ed73

Browse files
Fix DeprecationWarning.
1 parent ae5f4b7 commit 938ed73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/tests/indexing/test_loc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ def test_loc_bool_incompatible_index_raises(self, index, frame_or_series):
21212121
# GH20432
21222122
message = "Boolean label can not be used without a boolean index"
21232123
if index.inferred_type != "boolean":
2124-
obj = frame_or_series(index=index)
2124+
obj = frame_or_series(index=index, dtype="object")
21252125
with pytest.raises(KeyError, match=message):
21262126
obj.loc[True]
21272127

@@ -2132,7 +2132,7 @@ def test_loc_bool_should_not_raise(self, frame_or_series):
21322132
def test_loc_bool_slice_raises(self, index, frame_or_series):
21332133
# GH20432
21342134
message = "Boolean values can not be used in a slice"
2135-
obj = frame_or_series(index=index)
2135+
obj = frame_or_series(index=index, dtype="object")
21362136
with pytest.raises(TypeError, match=message):
21372137
obj.loc[True:False]
21382138

0 commit comments

Comments
 (0)