diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 4019f02f32a29..4fc0b49e6f5a3 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -235,7 +235,7 @@ cpdef int64_t delta_to_nanoseconds( cdef: NPY_DATETIMEUNIT in_reso - int64_t n, value, factor + int64_t n if is_tick_object(delta): n = delta.n @@ -278,8 +278,6 @@ cpdef int64_t delta_to_nanoseconds( f"Cannot cast {str(delta)} to unit={unit_str} without overflow." ) from err - return value - @cython.overflowcheck(True) cdef object ensure_td64ns(object ts):