@@ -1293,11 +1293,7 @@ cdef class BusinessDay(BusinessMixin):
1293
1293
self ._offset = state.pop(" _offset" )
1294
1294
elif " offset" in state:
1295
1295
self ._offset = state.pop(" offset" )
1296
-
1297
- @property
1298
- def _params (self ):
1299
- # FIXME: using cache_readonly breaks a pytables test
1300
- return BaseOffset._params.func(self )
1296
+ self ._cache = state.pop(" _cache" , {})
1301
1297
1302
1298
def _offset_str (self ) -> str:
1303
1299
def get_str(td ):
@@ -1384,8 +1380,6 @@ cdef class BusinessDay(BusinessMixin):
1384
1380
if self .n > 0 :
1385
1381
shifted = (dtindex.to_perioddelta(" B" ) - time).asi8 != 0
1386
1382
1387
- # Integer-array addition is deprecated, so we use
1388
- # _time_shift directly
1389
1383
roll = np.where(shifted, self .n - 1 , self .n)
1390
1384
shifted = asper._addsub_int_array(roll, operator.add)
1391
1385
else :
@@ -2483,12 +2477,7 @@ cdef class Week(SingleConstructorOffset):
2483
2477
self .n = state.pop(" n" )
2484
2478
self .normalize = state.pop(" normalize" )
2485
2479
self .weekday = state.pop(" weekday" )
2486
-
2487
- @property
2488
- def _params (self ):
2489
- # TODO: making this into a property shouldn't be necessary, but otherwise
2490
- # we unpickle legacy objects incorrectly
2491
- return BaseOffset._params.func(self )
2480
+ self ._cache = state.pop(" _cache" , {})
2492
2481
2493
2482
def is_anchored (self ) -> bool:
2494
2483
return self.n == 1 and self.weekday is not None
@@ -2537,7 +2526,7 @@ cdef class Week(SingleConstructorOffset):
2537
2526
from .frequencies import get_freq_code # TODO: avoid circular import
2538
2527
2539
2528
i8other = dtindex.asi8
2540
- off = (i8other % DAY_NANOS).view(" timedelta64" )
2529
+ off = (i8other % DAY_NANOS).view(" timedelta64[ns] " )
2541
2530
2542
2531
base, mult = get_freq_code(self .freqstr)
2543
2532
base_period = dtindex.to_period(base)
0 commit comments