Skip to content

Commit 903237a

Browse files
committed
ENH: Timestamp +- timedeltalike scalar support non-nano
1 parent 696e9bd commit 903237a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/_libs/tslibs/timestamps.pyx

+6-2
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,14 @@ cdef class _Timestamp(ABCTimestamp):
400400
new_value = int(self.value) + int(nanos)
401401

402402
try:
403-
result = type(self)._from_value_and_reso(new_value, reso=self._reso, tz=self.tzinfo)
403+
result = type(self)._from_value_and_reso(
404+
new_value, reso=self._reso, tz=self.tzinfo
405+
)
404406
except OverflowError as err:
405407
# TODO: don't hard-code nanosecond here
406-
raise OutOfBoundsDatetime(f"Out of bounds nanosecond timestamp: {new_value}") from err
408+
raise OutOfBoundsDatetime(
409+
f"Out of bounds nanosecond timestamp: {new_value}"
410+
) from err
407411

408412
if result is not NaT:
409413
result._set_freq(self._freq) # avoid warning in constructor

0 commit comments

Comments
 (0)