Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pandas/_libs/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ def _test_parse_iso8601(ts: str):
_TSObject obj
int out_local = 0, out_tzoffset = 0
NPY_DATETIMEUNIT out_bestunit
bint failed

obj = _TSObject()

string_to_dts(ts, &obj.dts, &out_bestunit, &out_local, &out_tzoffset, True)
failed = string_to_dts(
ts, &obj.dts, &out_bestunit, &out_local, &out_tzoffset, False
)
if failed:
raise ValueError("string_to_dts failed")
try:
obj.value = npy_datetimestruct_to_datetime(NPY_FR_ns, &obj.dts)
except OverflowError as err:
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/np_datetime.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ cdef int string_to_dts(
bint want_exc,
str format = *,
bint exact = *
) except? -1
)

cdef NPY_DATETIMEUNIT get_unit_from_dtype(cnp.dtype dtype)

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/np_datetime.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ cdef int string_to_dts(
bint want_exc,
str format=None,
bint exact=True,
) except? -1:
):
cdef:
Py_ssize_t length
const char* buf
Expand Down
Loading