Skip to content

Commit 99f8afd

Browse files
committed
Add check for EA instance in _inst_from_senior_cls
1 parent 8966432 commit 99f8afd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/core/ops.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
is_scalar, is_timedelta64_dtype, needs_i8_conversion)
3131
from pandas.core.dtypes.generic import (
3232
ABCDataFrame, ABCIndex, ABCIndexClass, ABCPanel, ABCSeries, ABCSparseArray,
33-
ABCSparseSeries)
33+
ABCSparseSeries, ABCExtensionArray)
3434
from pandas.core.dtypes.missing import isna, notna
3535

3636
import pandas as pd
@@ -178,10 +178,11 @@ def wrapper(comp_self, comp_other):
178178
def _inst_from_senior_cls(self, comp):
179179
@wraps(comp)
180180
def wrapper(comp_self, comp_other):
181-
if isinstance(comp_other, (ABCDataFrame,
182-
ABCSeries, ABCIndexClass)):
183-
# Rely on pandas to unbox and dispatch to us.
184-
return NotImplemented
181+
if isinstance(comp_self, ABCExtensionArray):
182+
if isinstance(comp_other, (ABCDataFrame, ABCSeries,
183+
ABCIndexClass)):
184+
# Rely on pandas to unbox and dispatch to us.
185+
return NotImplemented
185186
return comp(comp_self, comp_other)
186187
return wrapper
187188

0 commit comments

Comments
 (0)