@@ -70,7 +70,6 @@ from pandas._libs.tslibs.conversion cimport (
70
70
from pandas._libs.tslibs.dtypes cimport npy_unit_to_abbrev
71
71
from pandas._libs.tslibs.nattype cimport (
72
72
NPY_NAT,
73
- c_NaT as NaT,
74
73
c_nat_strings as nat_strings,
75
74
)
76
75
from pandas._libs.tslibs.timestamps cimport _Timestamp
@@ -346,39 +345,6 @@ def array_with_unit_to_datetime(
346
345
return result, tz
347
346
348
347
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
-
382
348
@ cython.wraparound (False )
383
349
@ cython.boundscheck (False )
384
350
def first_non_null (values: ndarray ) -> int:
0 commit comments