There was an error while loading. Please reload this page.
1 parent 1385e66 commit ac80418Copy full SHA for ac80418
pandas/core/arrays/datetimes.py
@@ -70,6 +70,7 @@
70
71
from pandas.tseries.frequencies import get_period_alias
72
from pandas.tseries.offsets import (
73
+ CustomBusinessDay,
74
Day,
75
Tick,
76
)
@@ -824,8 +825,18 @@ def _add_offset(self, offset: BaseOffset) -> Self:
824
825
"s",
826
]
827
res_unit = self.unit
- if isinstance(offset, Tick):
828
- ns = abs(int(offset.value))
+ if isinstance(offset, Tick) or (
829
+ isinstance(offset, CustomBusinessDay)
830
+ and offset.offset is not None
831
+ and offset.offset.value != 0
832
+ ):
833
+ ns = abs(
834
+ int(
835
+ offset.value
836
+ if isinstance(offset, Tick)
837
+ else offset.offset.value
838
+ )
839
840
if ns == 0:
841
eff_unit = self.unit
842
elif ns % 1_000_000_000 == 0:
0 commit comments