@@ -988,9 +988,6 @@ def _add_delta_tdi(self, other):
988
988
Add a delta of a TimedeltaIndex
989
989
return the i8 result view
990
990
"""
991
- if len (self ) != len (other ):
992
- raise ValueError ("cannot add indices of unequal length" )
993
-
994
991
if isinstance (other , np .ndarray ):
995
992
# ndarray[timedelta64]; wrap in TimedeltaIndex for op
996
993
from pandas import TimedeltaIndex
@@ -1055,9 +1052,6 @@ def _sub_period_array(self, other):
1055
1052
.format (dtype = other .dtype ,
1056
1053
cls = type (self ).__name__ ))
1057
1054
1058
- if len (self ) != len (other ):
1059
- raise ValueError ("cannot subtract arrays/indices of "
1060
- "unequal length" )
1061
1055
if self .freq != other .freq :
1062
1056
msg = DIFFERENT_FREQ .format (cls = type (self ).__name__ ,
1063
1057
own_freq = self .freqstr ,
@@ -1176,7 +1170,7 @@ def _time_shift(self, periods, freq=None):
1176
1170
return self ._generate_range (start = start , end = end , periods = None ,
1177
1171
freq = self .freq )
1178
1172
1179
- @CompWrapper (zerodim = True , inst_from_senior_cls = True )
1173
+ @CompWrapper (zerodim = True , inst_from_senior_cls = True , validate_len = True )
1180
1174
def __add__ (self , other ):
1181
1175
# scalar others
1182
1176
if other is NaT :
@@ -1236,7 +1230,7 @@ def __radd__(self, other):
1236
1230
# alias for __add__
1237
1231
return self .__add__ (other )
1238
1232
1239
- @CompWrapper (zerodim = True , inst_from_senior_cls = True )
1233
+ @CompWrapper (zerodim = True , inst_from_senior_cls = True , validate_len = True )
1240
1234
def __sub__ (self , other ):
1241
1235
# scalar others
1242
1236
if other is NaT :
0 commit comments