From 2d16863717c82457522aa915249ba185df79a9c2 Mon Sep 17 00:00:00 2001 From: Richard Shadrach <45562402+rhshadrach@users.noreply.github.com> Date: Fri, 22 Sep 2023 10:59:38 -0400 Subject: [PATCH] PERF: Add type-hints in tzconversion.pyx (#55241) --- doc/source/whatsnew/v2.2.0.rst | 2 +- pandas/_libs/tslibs/tzconversion.pyx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index 8eab623a2b5f7..ebca1605be8d5 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -238,7 +238,7 @@ Performance improvements - Performance improvement in :meth:`DataFrame.sort_index` and :meth:`Series.sort_index` when indexed by a :class:`MultiIndex` (:issue:`54835`) - Performance improvement in :meth:`Index.difference` (:issue:`55108`) - Performance improvement when indexing with more than 4 keys (:issue:`54550`) -- +- Performance improvement when localizing time to UTC (:issue:`55241`) .. --------------------------------------------------------------------------- .. _whatsnew_220.bug_fixes: diff --git a/pandas/_libs/tslibs/tzconversion.pyx b/pandas/_libs/tslibs/tzconversion.pyx index e17d264333264..a96779aa33255 100644 --- a/pandas/_libs/tslibs/tzconversion.pyx +++ b/pandas/_libs/tslibs/tzconversion.pyx @@ -462,7 +462,7 @@ cdef str _render_tstamp(int64_t val, NPY_DATETIMEUNIT creso): cdef _get_utc_bounds( - ndarray vals, + ndarray[int64_t] vals, int64_t* tdata, Py_ssize_t ntrans, const int64_t[::1] deltas, @@ -472,7 +472,7 @@ cdef _get_utc_bounds( # result_a) or right of the DST transition (store in result_b) cdef: - ndarray result_a, result_b + ndarray[int64_t] result_a, result_b Py_ssize_t i, n = vals.size int64_t val, v_left, v_right Py_ssize_t isl, isr, pos_left, pos_right