Skip to content

Commit fb6a833

Browse files
authored
CLN: remove normalize_datetime (#34016)
1 parent c293a88 commit fb6a833

File tree

4 files changed

+7
-49
lines changed

4 files changed

+7
-49
lines changed

pandas/_libs/tslibs/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
__all__ = [
22
"localize_pydatetime",
3-
"normalize_date",
43
"NaT",
54
"NaTType",
65
"iNaT",
@@ -17,7 +16,7 @@
1716
]
1817

1918

20-
from .conversion import localize_pydatetime, normalize_date
19+
from .conversion import localize_pydatetime
2120
from .nattype import NaT, NaTType, iNaT, is_null_datetimelike
2221
from .np_datetime import OutOfBoundsDatetime
2322
from .period import IncompatibleFrequency, Period

pandas/core/arrays/datetimes.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from datetime import datetime, time, timedelta
2-
from typing import Union
2+
from typing import Optional, Union
33
import warnings
44

55
import numpy as np
@@ -13,7 +13,6 @@
1313
conversion,
1414
fields,
1515
iNaT,
16-
normalize_date,
1716
resolution as libresolution,
1817
timezones,
1918
tzconversion,
@@ -2288,19 +2287,21 @@ def _infer_tz_from_endpoints(start, end, tz):
22882287
return tz
22892288

22902289

2291-
def _maybe_normalize_endpoints(start, end, normalize):
2290+
def _maybe_normalize_endpoints(
2291+
start: Optional[Timestamp], end: Optional[Timestamp], normalize: bool
2292+
):
22922293
_normalized = True
22932294

22942295
if start is not None:
22952296
if normalize:
2296-
start = normalize_date(start)
2297+
start = start.normalize()
22972298
_normalized = True
22982299
else:
22992300
_normalized = _normalized and start.time() == _midnight
23002301

23012302
if end is not None:
23022303
if normalize:
2303-
end = normalize_date(end)
2304+
end = end.normalize()
23042305
_normalized = True
23052306
else:
23062307
_normalized = _normalized and end.time() == _midnight

pandas/tests/tslibs/test_api.py

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def test_namespace():
3838
"delta_to_nanoseconds",
3939
"ints_to_pytimedelta",
4040
"localize_pydatetime",
41-
"normalize_date",
4241
"tz_convert_single",
4342
]
4443

pandas/tests/tslibs/test_normalize_date.py

-41
This file was deleted.

0 commit comments

Comments
 (0)