@@ -70,7 +70,6 @@ from pandas._libs.tslibs.conversion cimport (
7070from pandas._libs.tslibs.dtypes cimport npy_unit_to_abbrev
7171from pandas._libs.tslibs.nattype cimport (
7272 NPY_NAT,
73- c_NaT as NaT,
7473 c_nat_strings as nat_strings,
7574)
7675from pandas._libs.tslibs.timestamps cimport _Timestamp
@@ -346,39 +345,6 @@ def array_with_unit_to_datetime(
346345 return result, tz
347346
348347
349- cdef _array_with_unit_to_datetime_object_fallback(ndarray[object ] values, str unit):
350- cdef:
351- Py_ssize_t i, n = len (values)
352- ndarray[object ] oresult
353- tzinfo tz = None
354-
355- # TODO: fix subtle differences between this and no-unit code
356- oresult = cnp.PyArray_EMPTY(values.ndim, values.shape, cnp.NPY_OBJECT, 0 )
357- for i in range (n):
358- val = values[i]
359-
360- if checknull_with_nat_and_na(val):
361- oresult[i] = < object > NaT
362- elif is_integer_object(val) or is_float_object(val):
363-
364- if val != val or val == NPY_NAT:
365- oresult[i] = < object > NaT
366- else :
367- try :
368- oresult[i] = Timestamp(val, unit = unit)
369- except OutOfBoundsDatetime:
370- oresult[i] = val
371-
372- elif isinstance (val, str ):
373- if len (val) == 0 or val in nat_strings:
374- oresult[i] = < object > NaT
375-
376- else :
377- oresult[i] = val
378-
379- return oresult, tz
380-
381-
382348@ cython.wraparound (False )
383349@ cython.boundscheck (False )
384350def first_non_null (values: ndarray ) -> int:
0 commit comments