Skip to content

Commit 7c050fd

Browse files
committed
DEBUG: Cython failures
1 parent d1c6404 commit 7c050fd

File tree

1,591 files changed

+37
-411685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,591 files changed

+37
-411685
lines changed

pandas/_libs/tslibs/timedeltas.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ cpdef int64_t get_unit_for_round(freq, NPY_DATETIMEUNIT creso) except? -1
99
cpdef int64_t delta_to_nanoseconds(
1010
delta, NPY_DATETIMEUNIT reso=*, bint round_ok=*
1111
) except? -1
12+
cpdef int64_t debug_divmod_bug(delta) except? -1
1213
cdef convert_to_timedelta64(object ts, str unit)
1314
cdef bint is_any_td_scalar(object obj)
1415

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,20 @@ def ints_to_pytimedelta(ndarray m8values, box=False):
233233
# ----------------------------------------------------------------------
234234

235235

236+
cpdef int64_t debug_divmod_bug(delta) except? -1:
237+
cdef int64_t n, div, mod, conv = 1000 * 1
238+
if PyDelta_Check(delta):
239+
n = (
240+
delta.days * 24 * 3600 * 1_000_000
241+
+ delta.seconds * 1_000_000
242+
+ delta.microseconds
243+
)
244+
else:
245+
raise ValueError("only timedelta is supported")
246+
div, mod = divmod(n, conv)
247+
return div
248+
249+
236250
cpdef int64_t delta_to_nanoseconds(
237251
delta,
238252
NPY_DATETIMEUNIT reso=NPY_FR_ns,

pandas/tests/api/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)