Skip to content

Commit d84b4ae

Browse files
committed
import right
1 parent 2e8573c commit d84b4ae

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

pandas/core/arrays/datetimelike.py

-31
Original file line numberDiff line numberDiff line change
@@ -1823,37 +1823,6 @@ def validate_periods(periods):
18231823
return periods
18241824

18251825

1826-
def validate_inclusiveness(inclusive):
1827-
"""
1828-
Check that the `inclusive` argument is among {"both", "neither", "left", "right"}.
1829-
1830-
Parameters
1831-
----------
1832-
inclusive : {"both", "neither", "left", "right"}
1833-
1834-
Returns
1835-
-------
1836-
left_inclusive : bool
1837-
right_inclusive : bool
1838-
1839-
Raises
1840-
------
1841-
ValueError : if argument is not among valid values
1842-
"""
1843-
left_right_inclusive: tuple[bool, bool] | None = {
1844-
"both": (True, True),
1845-
"left": (True, False),
1846-
"right": (False, True),
1847-
"neither": (False, False),
1848-
}.get(inclusive)
1849-
1850-
if left_right_inclusive is None:
1851-
raise ValueError(
1852-
"Inclusive has to be either 'both', 'neither', 'left', 'right'"
1853-
)
1854-
return left_right_inclusive
1855-
1856-
18571826
def validate_inferred_freq(freq, inferred_freq, freq_infer):
18581827
"""
18591828
If the user passes a freq and another freq is inferred from passed data,

pandas/core/arrays/datetimes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
)
4040
from pandas._typing import npt
4141
from pandas.errors import PerformanceWarning
42-
from pandas.util._validators import validate_endpoints
42+
from pandas.util._validators import validate_inclusive
4343

4444
from pandas.core.dtypes.cast import astype_dt64_to_dt64tz
4545
from pandas.core.dtypes.common import (
@@ -417,7 +417,7 @@ def _generate_range(
417417
if start is NaT or end is NaT:
418418
raise ValueError("Neither `start` nor `end` can be NaT")
419419

420-
left_inclusive, right_inclusive = dtl.validate_inclusiveness(inclusive)
420+
left_inclusive, right_inclusive = validate_inclusive(inclusive)
421421
start, end, _normalized = _maybe_normalize_endpoints(start, end, normalize)
422422
tz = _infer_tz_from_endpoints(start, end, tz)
423423

0 commit comments

Comments
 (0)