-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPR: Index.__getitem__[bool] GH#44051 #44973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -670,6 +670,21 @@ def test_getitem_2d_deprecated(self, simple_index): | |
|
||
assert isinstance(res, np.ndarray), type(res) | ||
|
||
if not isinstance(idx, RangeIndex): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about a list of bools? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure, but definitely out of scope There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kk |
||
# GH#44051 RangeIndex already raises | ||
with tm.assert_produces_warning(FutureWarning, match=msg): | ||
res = idx[True] | ||
assert isinstance(res, np.ndarray), type(res) | ||
with tm.assert_produces_warning(FutureWarning, match=msg): | ||
res = idx[False] | ||
assert isinstance(res, np.ndarray), type(res) | ||
else: | ||
msg = "only integers, slices" | ||
with pytest.raises(IndexError, match=msg): | ||
idx[True] | ||
with pytest.raises(IndexError, match=msg): | ||
idx[False] | ||
|
||
def test_copy_shares_cache(self, simple_index): | ||
# GH32898, GH36840 | ||
idx = simple_index | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have other deprecated indexing like this? can you co-locate (followup ok too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think from a previous version, so the note will be in a different file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk that's fine then