@@ -8,6 +8,7 @@ from io import StringIO
88from libc.string cimport strchr
99
1010import cython
11+ from cython import Py_ssize_t
1112
1213from cpython cimport PyObject_Str, PyUnicode_Join
1314
@@ -607,7 +608,8 @@ def try_parse_date_and_time(object[:] dates, object[:] times,
607608 object [:] result
608609
609610 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:
611613 raise ValueError (' Length of dates and times must be equal' )
612614 result = np.empty(n, dtype = ' O' )
613615
@@ -643,7 +645,8 @@ def try_parse_year_month_day(object[:] years, object[:] months,
643645 object [:] result
644646
645647 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:
647650 raise ValueError (' Length of years/months/days must all be equal' )
648651 result = np.empty(n, dtype = ' O' )
649652
@@ -668,8 +671,10 @@ def try_parse_datetime_components(object[:] years,
668671 double micros
669672
670673 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):
673678 raise ValueError (' Length of all datetime components must be equal' )
674679 result = np.empty(n, dtype = ' O' )
675680
0 commit comments