@@ -577,8 +577,8 @@ def try_parse_date_and_time(object[:] dates, object[:] times,
577
577
object [:] result
578
578
579
579
n = len (dates)
580
- # Cast to avoid build warning see GH#26757
581
- if < Py_ssize_t > len ( times) != n:
580
+ # TODO(cython 3.0): Use len instead of `shape[0]`
581
+ if times.shape[ 0 ] != n:
582
582
raise ValueError (' Length of dates and times must be equal' )
583
583
result = np.empty(n, dtype = ' O' )
584
584
@@ -614,8 +614,8 @@ def try_parse_year_month_day(object[:] years, object[:] months,
614
614
object [:] result
615
615
616
616
n = len (years)
617
- # Cast to avoid build warning see GH#26757
618
- if < Py_ssize_t > len ( months) != n or < Py_ssize_t > len ( days) != n:
617
+ # TODO(cython 3.0): Use len instead of `shape[0]`
618
+ if months.shape[ 0 ] != n or days.shape[ 0 ] != n:
619
619
raise ValueError (' Length of years/months/days must all be equal' )
620
620
result = np.empty(n, dtype = ' O' )
621
621
@@ -640,10 +640,14 @@ def try_parse_datetime_components(object[:] years,
640
640
double micros
641
641
642
642
n = len (years)
643
- # Cast to avoid build warning see GH#26757
644
- if (< Py_ssize_t> len (months) != n or < Py_ssize_t> len (days) != n or
645
- < Py_ssize_t> len (hours) != n or < Py_ssize_t> len (minutes) != n or
646
- < Py_ssize_t> len (seconds) != n):
643
+ # TODO(cython 3.0): Use len instead of `shape[0]`
644
+ if (
645
+ months.shape[0 ] != n
646
+ or days.shape[0 ] != n
647
+ or hours.shape[0 ] != n
648
+ or minutes.shape[0 ] != n
649
+ or seconds.shape[0 ] != n
650
+ ):
647
651
raise ValueError (' Length of all datetime components must be equal' )
648
652
result = np.empty(n, dtype = ' O' )
649
653
0 commit comments