Skip to content

Commit 525501d

Browse files
authored
Remove unused tslib function (#58198)
1 parent 5376e2a commit 525501d

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

pandas/_libs/tslib.pyx

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ from pandas._libs.tslibs.conversion cimport (
7070
from pandas._libs.tslibs.dtypes cimport npy_unit_to_abbrev
7171
from pandas._libs.tslibs.nattype cimport (
7272
NPY_NAT,
73-
c_NaT as NaT,
7473
c_nat_strings as nat_strings,
7574
)
7675
from 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)
384350
def first_non_null(values: ndarray) -> int:

0 commit comments

Comments
 (0)