-
-
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
TST: Add ExtensionArray base tests for ops between pandas objects and EAs #22974
Comments
and also the interaction with non-pandas objects (lists, arrays) |
Tangentially related, I noticed today that In [3]: arr = np.array([1, 2])
In [4]: divmod(arr, pd.Series(arr))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-4-b14c14fd32f3> in <module>
----> 1 divmod(arr, pd.Series(arr))
TypeError: unsupported operand type(s) for divmod(): 'numpy.ndarray' and 'Series' Given that both division on mod work, divmod probably should as well. |
I think this is #19252. |
I think this is sufficiently documented in |
It's indeed written in the docs, but do we actually properly test it in the base tests? Because eg pandas/pandas/tests/extension/base/ops.py Lines 83 to 88 in 6bf6cd2
is actually testing the op with series and series, not series and array. And we also don't have it with eg Index or DataFrame. |
Ok, will re-purpose for tests. |
We should document the expected behavior for binary operations between ExtensionArrays and pandas' own objects (Series, DataFrame, Index). We should update our own EAs to match the docs.
Out[4]
should be a Series with "Int64" dtype, to match the behavior of ndarray + series.We've documented this, but need to test between series, index, dataframe, and the array class
pandas/pandas/tests/extension/base/ops.py
Lines 83 to 88 in 6bf6cd2
The text was updated successfully, but these errors were encountered: