@@ -8,6 +8,7 @@ from io import StringIO
8
8
from libc.string cimport strchr
9
9
10
10
import cython
11
+ from cython import Py_ssize_t
11
12
12
13
from cpython cimport PyObject_Str, PyUnicode_Join
13
14
@@ -607,7 +608,8 @@ def try_parse_date_and_time(object[:] dates, object[:] times,
607
608
object [:] result
608
609
609
610
n = len (dates)
610
- if len (times) != n:
611
+ # Cast to avoid build warning see GH#26757
612
+ if < Py_ssize_t> len (times) != n:
611
613
raise ValueError (' Length of dates and times must be equal' )
612
614
result = np.empty(n, dtype = ' O' )
613
615
@@ -643,7 +645,8 @@ def try_parse_year_month_day(object[:] years, object[:] months,
643
645
object [:] result
644
646
645
647
n = len (years)
646
- if len (months) != n or len (days) != n:
648
+ # Cast to avoid build warning see GH#26757
649
+ if < Py_ssize_t> len (months) != n or < Py_ssize_t> len (days) != n:
647
650
raise ValueError (' Length of years/months/days must all be equal' )
648
651
result = np.empty(n, dtype = ' O' )
649
652
@@ -668,8 +671,10 @@ def try_parse_datetime_components(object[:] years,
668
671
double micros
669
672
670
673
n = len (years)
671
- if (len (months) != n or len (days) != n or len (hours) != n or
672
- len (minutes) != n or len (seconds) != n):
674
+ # Cast to avoid build warning see GH#26757
675
+ if (< Py_ssize_t> len (months) != n or < Py_ssize_t> len (days) != n or
676
+ < Py_ssize_t> len (hours) != n or < Py_ssize_t> len (minutes) != n or
677
+ < Py_ssize_t> len (seconds) != n):
673
678
raise ValueError (' Length of all datetime components must be equal' )
674
679
result = np.empty(n, dtype = ' O' )
675
680
0 commit comments