Skip to content

Commit 00ad36c

Browse files
committed
BUG: Fix dt64[non_nano] + offset rounding
1 parent c6c2fad commit 00ad36c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/arrays/datetimes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,11 @@ def _add_offset(self, offset: BaseOffset) -> Self:
829829
micro = offset.kwds.get("microseconds", 0)
830830
if micro and self.unit != "ns":
831831
res_unit = "us"
832-
elif hasattr(offset, "offset") and offset.offset is not None:
832+
if (
833+
hasattr(offset, "offset")
834+
and offset.offset is not None
835+
and not isinstance(offset, Tick)
836+
):
833837
offset_td = Timedelta(offset.offset)
834838
if offset_td.value != 0:
835839
offset_unit = offset_td.unit

0 commit comments

Comments
 (0)