-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
TST: Verify operators with IntegerArray and list-likes (22606) #35987
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
Changes from 3 commits
60982b4
71d3011
02dcea9
f657d21
bc7be38
04706e1
4ef23fc
7770147
73a95c5
f5fba51
0afc206
99685e5
09c38b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
import numpy as np | ||
import pytest | ||
|
||
from pandas import Series | ||
import pandas._testing as tm | ||
from pandas.core.ops.array_ops import comparison_op, na_logical_op | ||
|
||
|
@@ -34,3 +35,15 @@ def test_object_comparison_2d(): | |
right.flags.writeable = False | ||
result = comparison_op(left, right, operator.ne) | ||
tm.assert_numpy_array_equal(result, ~expected) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"data, expected", [([0, 1, 2], [0, 2, 4])], | ||
) | ||
def test_extension_array_add(box_1d_array, data, expected): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you parameterize ser on Series, to_array, Index (you can just make another box parameter but doesn't need to go in conftest it can be here) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on master it seems that Index and to_array do not yet support initialization from an ExtensionArray. Series dtype is correctly set to Int64, but Index and to_array have an object dtype and not an integer dtype. Do we then still want to add parametrize ser?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Index is correct. the to_array actually need to be fixed to simply call pd.array (try this and see if it just works, if it does ok), if now we can do after. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add parametrization to test Series, Didnt update the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jreback could you have a 2nd look? Thanks! |
||
# GH22606 Verify operators with Extension Array and list-likes | ||
ser = Series(data, dtype="Int64") | ||
results = ser + box_1d_array(data) | ||
|
||
jreback marked this conversation as resolved.
Show resolved
Hide resolved
|
||
expected = Series(expected, dtype="Int64") | ||
tm.assert_series_equal(results, expected) |
Uh oh!
There was an error while loading. Please reload this page.