Skip to content

Conversation

@mroeschke
Copy link
Member

Bug in main so no whatsnew needed.

I'm not sure why ABCExtensionArray doesn't cover ABCNumpyExtensionArray, but that would probably be too large of a change for this issue.

@mroeschke mroeschke added this to the 3.0 milestone Dec 17, 2025
@mroeschke mroeschke added Bug ExtensionArray Extending pandas with custom dtypes or arrays. labels Dec 17, 2025
@jorisvandenbossche
Copy link
Member

It might not be just the length 1 case, I see that a longer one is also buggy, but in a different way (returning a wrong result instead of error). Can you check if this is also solved by this change and if so maybe add a test for it as well?

>>> idx = pd.RangeIndex(5)
>>> idx[np.array([True, True, False, False, True])]
Index([0, 1, 4], dtype='int64')
>>> idx[pd.Series([True, True, False, False, True])]
Index([0, 1, 4], dtype='int64')
>>> idx[pd.Series([True, True, False, False, True]).array]
Index([1, 1, 0, 0, 1], dtype='int64')

@mroeschke
Copy link
Member Author

Can you check if this is also solved by this change and if so maybe add a test for it as well?

Sure, added the test since this case was fixed as well

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mroeschke mroeschke merged commit ec63444 into pandas-dev:main Dec 17, 2025
41 checks passed
@mroeschke mroeschke deleted the bug/is_bool_indexer/numpyea branch December 17, 2025 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug ExtensionArray Extending pandas with custom dtypes or arrays.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REGR: RangeIndex __getitem__ filtering with boolean extension array of length 1

2 participants