Skip to content

BUG: Fix ExtensionArray binary op protocol #61990

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

tisjayy
Copy link
Contributor

@tisjayy tisjayy commented Jul 29, 2025

@tisjayy tisjayy closed this Jul 29, 2025
@tisjayy tisjayy reopened this Jul 29, 2025
@tisjayy tisjayy force-pushed the fix-ea-non-1d-ops branch from f9cb022 to 9496569 Compare July 29, 2025 05:21
@tisjayy

This comment was marked as resolved.

@tisjayy

This comment was marked as resolved.

@tisjayy tisjayy closed this Jul 29, 2025
@tisjayy tisjayy reopened this Jul 29, 2025
@tisjayy tisjayy closed this Jul 29, 2025
@tisjayy tisjayy reopened this Jul 29, 2025
@tisjayy

This comment was marked as resolved.

@tisjayy tisjayy changed the title BUG: NotImplemented for non-1D BooleanArray ops; add numeric EA shape error tests BUG: Fix ExtensionArray binary op protocol, return NotImplemented instead of raising NotImplementedError Jul 29, 2025
@tisjayy tisjayy changed the title BUG: Fix ExtensionArray binary op protocol, return NotImplemented instead of raising NotImplementedError BUG: Fix ExtensionArray binary op protocol Jul 29, 2025
@mroeschke mroeschke requested a review from jbrockmendel July 30, 2025 16:11
@mroeschke mroeschke added Numeric Operations Arithmetic, Comparison, and Logical operations ExtensionArray Extending pandas with custom dtypes or arrays. labels Jul 30, 2025
ea_array = array([1, 2, 3, 4, 5], dtype="Int64")
result = np_array * ea_array
assert isinstance(result, type(ea_array))
tm.assert_equal(result, array([1, 4, 9, 16, 25], dtype="Int64"))
Copy link
Member

Choose a reason for hiding this comment

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

is this actually affected by this PR? if not i expect it is already tested?

Copy link
Contributor Author

@tisjayy tisjayy Jul 31, 2025

Choose a reason for hiding this comment

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

Test checks that multiplying a NumPy array by an ExtensionArray gives the correct type (an ExtensionArray), which means the fallback via NotImplemented is working as intended. I couldnt find anything similar in test_numeric.py or some other files i tried to look into.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you think its checked elsewhere, i will remove it

@tisjayy

This comment was marked as resolved.

@tisjayy

This comment was marked as resolved.

@tisjayy tisjayy requested review from arthurlw and jbrockmendel July 31, 2025 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Operations not implemented for non-1D ExtensionArrays
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy