From f2b5f6d49740ccee33f3295610505b5aa5adf8a3 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Fri, 13 Oct 2023 09:32:29 -0400 Subject: [PATCH 1/2] updated parameter definitions --- pandas/_libs/tslibs/tzconversion.pyx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandas/_libs/tslibs/tzconversion.pyx b/pandas/_libs/tslibs/tzconversion.pyx index a96779aa33255..ac95343436d66 100644 --- a/pandas/_libs/tslibs/tzconversion.pyx +++ b/pandas/_libs/tslibs/tzconversion.pyx @@ -425,7 +425,11 @@ timedelta-like} return result.base # .base to get underlying ndarray -cdef Py_ssize_t bisect_right_i8(int64_t *data, int64_t val, Py_ssize_t n): +cdef Py_ssize_t bisect_right_i8( + const int64_t *data, + int64_t val, + Py_ssize_t n +) noexcept: # Caller is responsible for checking n > 0 # This looks very similar to local_search_right in the ndarray.searchsorted # implementation. @@ -462,8 +466,8 @@ cdef str _render_tstamp(int64_t val, NPY_DATETIMEUNIT creso): cdef _get_utc_bounds( - ndarray[int64_t] vals, - int64_t* tdata, + const int64_t[:] vals, + const int64_t* tdata, Py_ssize_t ntrans, const int64_t[::1] deltas, NPY_DATETIMEUNIT creso, From f4955d9557c5ac540b6ff6111233dbc9d98d5978 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Fri, 13 Oct 2023 10:45:56 -0400 Subject: [PATCH 2/2] revert memview -> ndarray declaration --- pandas/_libs/tslibs/tzconversion.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/tzconversion.pyx b/pandas/_libs/tslibs/tzconversion.pyx index ac95343436d66..9c8865fbdf428 100644 --- a/pandas/_libs/tslibs/tzconversion.pyx +++ b/pandas/_libs/tslibs/tzconversion.pyx @@ -466,7 +466,7 @@ cdef str _render_tstamp(int64_t val, NPY_DATETIMEUNIT creso): cdef _get_utc_bounds( - const int64_t[:] vals, + ndarray[int64_t] vals, const int64_t* tdata, Py_ssize_t ntrans, const int64_t[::1] deltas,