Open jamesdow21 opened 4 months ago
Thanks for the report! I agree the behavior of addition and multiplication should be consistent. Addition and multiplication are commutative so a + b
should be equal to b + a
(even if it means both should fail to accomplish this commutativity)
PR to fix this would be welcome.
The error is ocurring in numeric.py
I believe pyarrow is not an instance of numpy array thus throwing an error. @Aloqeely
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Adding or multiplying a pandas nullable dtype Series with a pyarrow backed dtype Series raises a TypeError, but reversing the order works as expected
Tested and confirmed that the same problem occurs for any combination of numeric pandas nullable dtypes and pyarrow dtypes
('Int8', 'Int16', 'Int32', 'Int64', 'UInt8', 'UInt16', 'UInt32', 'UInt64', 'Float32', 'Float64') and ('int8[pyarrow]', 'int16[pyarrow]', 'int32[pyarrow]', 'int64[pyarrow]', 'uint8[pyarrow]', uint16[pyarrow]', 'uint32[pyarrow]', 'uint64[pyarrow]', 'float32[pyarrow]', 'float64[pyarrow]']) respectively
Expected Behavior
Addition and multiplication should work with either order of operands
Installed Versions