Skip to content

Commit e27110a

Browse files
committed
BUG: Fix dt64[non_nano] + offset rounding
1 parent ba029d1 commit e27110a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/core/arrays/datetimes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
tzconversion,
4747
)
4848
from pandas._libs.tslibs.dtypes import abbrev_to_npy_unit
49+
from pandas._libs.tslibs.offsets import DateOffset
4950
from pandas.errors import PerformanceWarning
5051
from pandas.util._exceptions import find_stack_level
5152
from pandas.util._validators import validate_inclusive
@@ -71,8 +72,6 @@
7172

7273
from pandas.tseries.frequencies import get_period_alias
7374
from pandas.tseries.offsets import (
74-
BusinessHour,
75-
CustomBusinessDay,
7675
Day,
7776
Tick,
7877
)
@@ -827,7 +826,7 @@ def _add_offset(self, offset: BaseOffset) -> Self:
827826
]
828827
res_unit = self.unit
829828
if hasattr(offset, "offset") and offset.offset is not None:
830-
if isinstance(offset, (CustomBusinessDay, BusinessHour)):
829+
if not isinstance(offset, DateOffset):
831830
offset_td = Timedelta(offset.offset)
832831
if offset_td.value != 0:
833832
offset_unit = offset_td.unit

0 commit comments

Comments
 (0)