BUG: EA inplace add (and other ops) with non-EA arg broken #37910
Labels
ExtensionArray
Extending pandas with custom dtypes or arrays.
Regression
Functionality that used to work in a prior pandas version
Milestone
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas (
1.0.4
).(optional) I have confirmed this bug exists on the master branch of pandas (
87247370c14629c1797fcf3540c6bd93b777a17e
).Code Sample, a copy-pastable example
Note that the issue is NOT specific to the integer EA, but happens with all EAs that don't use NumPy dtypes.
Problem description
This is likely a fallout of #37508. See here:
pandas/pandas/core/generic.py
Lines 11283 to 11292 in 8724737
There, the result dtype (which is a NumPy dtype in this case) is compared with the EA dtype. This raises the TypeError, because NumPy only allows comparing its dtype objects with "real" NumPy dtypes (and EAs don't provide NumPy-compatible dtypes).
Expected Output
Pass. I'm pretty sure that worked with
1.0.3
(the mentioned PR in question was backported to the1.0.x
branch between the1.0.3
and1.0.4
release).The text was updated successfully, but these errors were encountered: