Skip to content

Commit

Permalink
CLN: unify a ValueError message for removed units T, L, U, N and remo…
Browse files Browse the repository at this point in the history
…ve these entries from UnitChoices (#59119)

cln: change msg in ValueError for units T, L, U, N
  • Loading branch information
natmokval authored Jun 27, 2024
1 parent 750d75e commit a89f208
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 22 deletions.
4 changes: 0 additions & 4 deletions pandas/_libs/tslibs/dtypes.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,6 @@ class Resolution(Enum):
"""
cdef:
str abbrev
if freq in {"T", "t", "L", "l", "U", "u", "N", "n"}:
raise ValueError(
f"Frequency \'{freq}\' is no longer supported."
)
try:
if freq in c_DEPR_ABBREVS:
abbrev = c_DEPR_ABBREVS[freq]
Expand Down
6 changes: 0 additions & 6 deletions pandas/_libs/tslibs/timedeltas.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ UnitChoices: TypeAlias = Literal[
"minute",
"min",
"minutes",
"T",
"t",
"s",
"seconds",
"sec",
Expand All @@ -50,21 +48,17 @@ UnitChoices: TypeAlias = Literal[
"millisecond",
"milli",
"millis",
"L",
"l",
"us",
"microseconds",
"microsecond",
"µs",
"micro",
"micros",
"u",
"ns",
"nanoseconds",
"nano",
"nanos",
"nanosecond",
"n",
]
_S = TypeVar("_S", bound=timedelta)

Expand Down
5 changes: 0 additions & 5 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1818,11 +1818,6 @@ class Timedelta(_Timedelta):
* 'microseconds', 'microsecond', 'micros', 'micro', or 'us'
* 'nanoseconds', 'nanosecond', 'nanos', 'nano', or 'ns'.
.. deprecated:: 2.2.0
Values `H`, `T`, `S`, `L`, `U`, and `N` are deprecated in favour
of the values `h`, `min`, `s`, `ms`, `us`, and `ns`.
.. deprecated:: 3.0.0
Allowing the values `w`, `d`, `MIN`, `MS`, `US` and `NS` to denote units
Expand Down
7 changes: 0 additions & 7 deletions pandas/tests/tslibs/test_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,3 @@ def test_units_H_S_deprecated_from_attrname_to_abbrevs(freq):

with tm.assert_produces_warning(FutureWarning, match=msg):
Resolution.get_reso_from_freqstr(freq)


@pytest.mark.parametrize("freq", ["T", "t", "L", "U", "N", "n"])
def test_reso_abbrev_T_L_U_N_raises(freq):
msg = f"Frequency '{freq}' is no longer supported."
with pytest.raises(ValueError, match=msg):
Resolution.get_reso_from_freqstr(freq)

0 comments on commit a89f208

Please sign in to comment.