-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
ENH: Enable indexing with nullable Boolean #31591
Merged
+109
−66
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
75c915f
Add test
9c5b9f0
Remove test that checks for error
2441b40
Add frame test
d71d1ba
Don't raise with nullable boolean
4d3a264
Don't modify result
543ef9a
Add frame test
d3e7a69
Update whatsnew
ad7ae66
Fill NA
6991394
Merge branch 'master' into bool-idx
f6e9ce5
Remove some more tests
1234407
Delete another test
9b7e879
Use to_numpy
efdd29a
Update whatsnew
7fa36b6
Don't check for NA
b8e3d6b
Revert "Remove test that checks for error"
bc3fe3f
Update NA test
73ad221
Revert "Remove some more tests"
547d7bc
Update Categorical test
5649445
Update getitem tests
bb3d143
Update indexers.py
f107252
tm -> self
7b924b7
Assert for EA not DataFrame
46d77df
Don't try / except
ac71cbf
Change check_indexer test
e5ed092
Modify __getitem__ for datetimelike
9fcdb23
Add back ValueError for non-boolean with NA
c2dfa93
Revert "Delete another test"
a9a12b1
Fixup error message
7c10f33
Add before and after examples
cf3d60d
Get rid of some tests
157d8b9
Cast another way
250f228
Import
647f0f6
Don't import unused
6ccd96d
Merge branch 'master' into bool-idx
a9e73de
Update whatsnew
adc3075
Update boolean.rst
29ff823
check_array_indexer docstring
0a58605
Edit 1.1.0 whatsnew
b38a209
Add to indexing.rst
5088cbb
Add back index parameter
54efdd9
Add some True values in test
c6b81ed
Edit boolean.rst
67800c6
Add list back to check_array_indexer test
4c334f3
Merge branch 'master' into bool-idx
578fd3c
Account for pd.NA in is_bool_indexer
a559385
Include list mask in test
705947e
Account for empty key
4974778
Revert "Account for empty key"
319b525
Revert "Account for pd.NA in is_bool_indexer"
8007ce4
Try modifying is_bool_indexer
a10765f
Revert "Try modifying is_bool_indexer"
d7fc3b7
Revert "Include list mask in test"
bca582e
Merge branch 'master' into bool-idx
6f9a298
Update release notes and docs
e1e39fe
Add issue number to tests
5a72b2f
Add some setitem tests
c0e8dc7
Revert "Add some setitem tests"
a293bc6
Merge branch 'master' into bool-idx
607d9ed
Update setitem tests
2e7f9b3
Merge branch 'master' into bool-idx
bfe472b
Merge branch 'master' into bool-idx
a6294f8
Merge branch 'master' into bool-idx
c6d23f6
Add setitem test
c8ee434
Merge branch 'master' into bool-idx
fbda99d
Move whatsnew note
dsaxton 3bf9327
Add back example
dsaxton dd65b0d
Merge branch 'master' into bool-idx
dsaxton 974ec5d
Merge remote-tracking branch 'upstream/master' into bool-idx
dsaxton 8f2d7bb
Merge remote-tracking branch 'upstream/master' into bool-idx
dsaxton 080d1d2
Update comment
dsaxton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Change check_indexer test
Removed the test on [True, False, None] which is no longer raising. Not clear to me what the correct behavior should be, but this is now returning a pandas array with pd.NA instead of None.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Test the behaviour, I would say (and I think it will convert a list to boolean array, so then further treats it as such)
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.
Yes, looks like it's behaving the same way as a boolean array with NA, but I wanted to note this because it might be unexpected to silently treat
None
aspd.NA
when passed in a list. I'll add it back to the test, which should pass as it's written now.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.
Ah, yes, that would indeed be a change in behaviour ..
I think I am fine with that (it's a corner case anyway to pass such mask as a list), but not fully sure. We can also punt for now on the list case (at least for Series, on the array level it should already work)