Skip to content

Commit f744ccd

Browse files
committed
Set inst_from_senior_cls as None
1 parent 96e5148 commit f744ccd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/core/arrays/datetimelike.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1170,8 +1170,11 @@ def _time_shift(self, periods, freq=None):
11701170
return self._generate_range(start=start, end=end, periods=None,
11711171
freq=self.freq)
11721172

1173-
@CompWrapper(zerodim=True, inst_from_senior_cls=True, validate_len=True)
1173+
@CompWrapper(zerodim=True, validate_len=True)
11741174
def __add__(self, other):
1175+
if isinstance(other, (ABCSeries, ABCDataFrame)):
1176+
return NotImplemented
1177+
11751178
# scalar others
11761179
if other is NaT:
11771180
result = self._add_nat()
@@ -1230,8 +1233,11 @@ def __radd__(self, other):
12301233
# alias for __add__
12311234
return self.__add__(other)
12321235

1233-
@CompWrapper(zerodim=True, inst_from_senior_cls=True, validate_len=True)
1236+
@CompWrapper(zerodim=True, validate_len=True)
12341237
def __sub__(self, other):
1238+
if isinstance(other, (ABCSeries, ABCDataFrame)):
1239+
return NotImplemented
1240+
12351241
# scalar others
12361242
if other is NaT:
12371243
result = self._sub_nat()

0 commit comments

Comments
 (0)