-
-
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 1 commit
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,20 @@ 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]), | ||
([0.0, 1.0, 2.0], [0.0, 2.0, 4.0]), | ||
(["a", "b", "c"], ["aa", "bb", "cc"]), | ||
], | ||
) | ||
def test_extension_array_add(box_extension_array, data, expected): | ||
# GH22606 Verify operators with Extension Array and list-likes | ||
ser = Series(data) | ||
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. Hi @avinashpancham , from what I've understood of #22606, this should hold an ExtensionArray (e.g. it could hold nullable integers, like 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. Oh I see. Updated it to test for a Series that holds an ExtensionArray. |
||
results = ser + box_extension_array(data) | ||
|
||
jreback marked this conversation as resolved.
Show resolved
Hide resolved
|
||
expected = Series(expected) | ||
tm.assert_series_equal(results, expected) |
Uh oh!
There was an error while loading. Please reload this page.