Skip to content

Commit 2ffda59

Browse files
committed
2 parents fffd340 + 91f72a0 commit 2ffda59

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pandas/core/tools/datetimes.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ def _convert_listlike_datetimes(
400400
-------
401401
Index-like of parsed dates
402402
"""
403-
404-
403+
404+
405405
if isinstance(arg, (list, tuple)):
406406
arg = np.array(arg, dtype="O")
407407
elif isinstance(arg, NumpyExtensionArray):
@@ -480,9 +480,9 @@ def _convert_listlike_datetimes(
480480

481481
if format is None:
482482
format = _guess_datetime_format_for_array(arg, dayfirst=dayfirst)
483-
483+
484484
# `format` could be inferred, or user didn't ask for mixed-format parsing.
485-
if format is not None and format != "mixed":
485+
if format is not None and format != "mixed":
486486
return _array_strptime_with_fallback(arg, name, utc, format, exact, errors)
487487

488488
result, tz_parsed = objects_to_datetime64ns(
@@ -1069,8 +1069,8 @@ def to_datetime(
10691069
DatetimeIndex(['2018-10-26 12:00:00+00:00', '2020-01-01 18:00:00+00:00'],
10701070
dtype='datetime64[ns, UTC]', freq=None)
10711071
"""
1072-
1073-
1072+
1073+
10741074
if exact is not lib.no_default and format in {"mixed","ISO8601"}:
10751075
raise ValueError("Cannot use 'exact' when 'format' is 'mixed' or 'ISO8601'")
10761076
if infer_datetime_format is not lib.no_default:
@@ -1089,7 +1089,7 @@ def to_datetime(
10891089
arg = _adjust_to_origin(arg, origin, unit)
10901090

10911091
convert_listlike = partial(
1092-
_convert_listlike_datetimes,
1092+
_convert_listlike_datetimes,
10931093
utc=utc,
10941094
unit=unit,
10951095
dayfirst=dayfirst,
@@ -1099,8 +1099,8 @@ def to_datetime(
10991099
)
11001100
# pylint: disable-next=used-before-assignment
11011101
result: Timestamp | NaTType | Series | Index
1102-
1103-
1102+
1103+
11041104

11051105
if isinstance(arg, Timestamp):
11061106
result = arg

pandas/tests/tools/test_to_datetime.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1090,8 +1090,8 @@ def test_to_datetime_now_with_format(self, format, expected_ds, string, attribut
10901090
[expected_ds, getattr(Timestamp, attribute)()], dtype="datetime64[ns, UTC]"
10911091
)
10921092
assert (expected - result).max().total_seconds() < 1
1093-
1094-
1093+
1094+
10951095
def test_to_datetime_where_formart_is_list(self):
10961096
# https://github.com/pandas-dev/pandas/issues/55226
10971097
data = ['2023-10-12','2023-10-13 14:30:00']
@@ -1102,8 +1102,8 @@ def test_to_datetime_where_formart_is_list(self):
11021102
freq=None
11031103
)
11041104
tm.assert_index_equal(result,expected)
1105-
1106-
1105+
1106+
11071107
@pytest.mark.parametrize(
11081108
"dt", [np.datetime64("2000-01-01"), np.datetime64("2000-01-02")]
11091109
)

0 commit comments

Comments
 (0)