Skip to content

Commit 7796934

Browse files
explicit defer in example implementation
1 parent 0a4e835 commit 7796934

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/arrays/base.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from pandas.core.dtypes.cast import maybe_cast_to_extension_array
2323
from pandas.core.dtypes.common import is_array_like, is_list_like, pandas_dtype
2424
from pandas.core.dtypes.dtypes import ExtensionDtype
25+
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
2526
from pandas.core.dtypes.missing import isna
2627

2728
from pandas.core import ops
@@ -1230,7 +1231,6 @@ def _create_method(cls, op, coerce_to_dtype=True, result_dtype=None):
12301231
of the underlying elements of the ExtensionArray
12311232
"""
12321233

1233-
@ops.unpack_zerodim_and_defer(op.__name__)
12341234
def _binop(self, other):
12351235
def convert_values(param):
12361236
if isinstance(param, ExtensionArray) or is_list_like(param):
@@ -1239,6 +1239,10 @@ def convert_values(param):
12391239
ovalues = [param] * len(self)
12401240
return ovalues
12411241

1242+
if isinstance(other, (ABCSeries, ABCIndexClass, ABCDataFrame)):
1243+
# rely on pandas to unbox and dispatch to us
1244+
return NotImplemented
1245+
12421246
lvalues = self
12431247
rvalues = convert_values(other)
12441248

0 commit comments

Comments
 (0)