Skip to content

Commit 3094a53

Browse files
author
MarcoGorelli
committed
simplify
1 parent 3143dd2 commit 3094a53

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

pandas/_libs/tslib.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,6 @@ cpdef array_to_datetime(
457457
bint yearfirst=False,
458458
bint utc=False,
459459
bint require_iso8601=False,
460-
format: str | None=None,
461-
bint exact=True,
462460
):
463461
"""
464462
Converts a 1D array of date-like values to a numpy array of either:
@@ -564,7 +562,7 @@ cpdef array_to_datetime(
564562
elif is_raise:
565563
raise ValueError(
566564
f"time data \"{val}\" at position {i} doesn't "
567-
f"match format \"{format}\""
565+
f"match ISO8601 standard"
568566
)
569567
return values, tz_out
570568
# these must be ns unit by-definition
@@ -597,7 +595,7 @@ cpdef array_to_datetime(
597595

598596
string_to_dts_failed = string_to_dts(
599597
val, &dts, &out_bestunit, &out_local,
600-
&out_tzoffset, False, format, exact
598+
&out_tzoffset, False, None, False
601599
)
602600
if string_to_dts_failed:
603601
# An error at this point is a _parsing_ error

pandas/core/arrays/datetimes.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,8 +2120,6 @@ def objects_to_datetime64ns(
21202120
errors: DateTimeErrorChoices = "raise",
21212121
require_iso8601: bool = False,
21222122
allow_object: bool = False,
2123-
format: str | None = None,
2124-
exact: bool = True,
21252123
):
21262124
"""
21272125
Convert data to array of timestamps.
@@ -2166,8 +2164,6 @@ def objects_to_datetime64ns(
21662164
dayfirst=dayfirst,
21672165
yearfirst=yearfirst,
21682166
require_iso8601=require_iso8601,
2169-
format=format,
2170-
exact=exact,
21712167
)
21722168
result = result.reshape(data.shape, order=order)
21732169
except OverflowError as err:

pandas/core/tools/datetimes.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,6 @@ def _convert_listlike_datetimes(
442442
utc=utc,
443443
errors=errors,
444444
allow_object=True,
445-
format=format,
446-
exact=exact,
447445
)
448446

449447
if tz_parsed is not None:

0 commit comments

Comments
 (0)