Skip to content

Commit 8b76a56

Browse files
committed
BUG: Fix pandas-dev#32822 that does not pass tests
1 parent edb863e commit 8b76a56

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pandas/core/ops/dispatch.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@
1717

1818
from pandas.core.construction import array
1919

20+
ARITHMETIC_BINOPS = [
21+
"add",
22+
"sub",
23+
"mul",
24+
"pow",
25+
"mod",
26+
"floordiv",
27+
"truediv",
28+
"divmod",
29+
"radd",
30+
"rsub",
31+
"rmul",
32+
"rpow",
33+
"rmod",
34+
"rfloordiv",
35+
"rtruediv",
36+
"rdivmod",
37+
]
38+
2039

2140
def should_extension_dispatch(left: ABCSeries, right: Any) -> bool:
2241
"""
@@ -68,6 +87,9 @@ def should_series_dispatch(left, right, op):
6887
# Note: this check must come before the check for nonempty columns.
6988
return True
7089

90+
if op.__name__.strip("_") in ARITHMETIC_BINOPS:
91+
return True
92+
7193
if right.ndim == 1:
7294
# operating with Series, short-circuit checks that would fail
7395
# with AttributeError.

0 commit comments

Comments
 (0)