Skip to content

Commit b1b5304

Browse files
committed
BUG: series of extension array add extension array values cause runtime exception pandas-dev#22478
1 parent 8a1c8ad commit b1b5304

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pandas/core/ops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ def dispatch_to_extension_op(op, left, right):
11821182
new_right = [new_right]
11831183
new_right = list(new_right)
11841184
elif is_extension_array_dtype(right) and type(left) != type(right):
1185-
new_right = list(new_right)
1185+
new_right = list(right)
11861186
else:
11871187
new_right = right
11881188

pandas/tests/arrays/test_integer.py

+8
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,14 @@ def test_cross_type_arithmetic():
587587
tm.assert_series_equal(result, expected)
588588

589589

590+
def test_arith_extension_array_values():
591+
592+
s = pd.Series([1, 2, 3], dtype='Int64')
593+
result = s + s.values
594+
expected = pd.Series([2, 4, 6], dtype='Int64')
595+
tm.assert_series_equal(result, expected)
596+
597+
590598
def test_groupby_mean_included():
591599
df = pd.DataFrame({
592600
"A": ['a', 'b', 'b'],

0 commit comments

Comments
 (0)