Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ class Timedelta(_Timedelta):

if unit in {'Y', 'y', 'M'}:
raise ValueError(
"Units 'M' and 'Y' are no longer supported, as they do not "
"Units 'M', 'Y', and 'y' are no longer supported, as they do not "
"represent unambiguous timedelta values durations."
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __new__(

if unit in {"Y", "y", "M"}:
raise ValueError(
"Units 'M' and 'Y' are no longer supported, as they do not "
"Units 'M', 'Y', and 'y' are no longer supported, as they do not "
"represent unambiguous timedelta values durations."
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/tools/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def to_timedelta(arg, unit=None, errors="raise"):

if unit in {"Y", "y", "M"}:
raise ValueError(
"Units 'M' and 'Y' are no longer supported, as they do not "
"Units 'M', 'Y', and 'y' are no longer supported, as they do not "
"represent unambiguous timedelta values durations."
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/indexes/timedeltas/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class TestTimedeltaIndex:
@pytest.mark.parametrize("unit", ["Y", "y", "M"])
def test_unit_m_y_raises(self, unit):
msg = "Units 'M' and 'Y' are no longer supported"
msg = "Units 'M', 'Y', and 'y' are no longer supported"
with pytest.raises(ValueError, match=msg):
TimedeltaIndex([1, 3, 7], unit)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/scalar/timedelta/test_timedelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def test_unit_parser(self, units, np_unit, wrapper):

@pytest.mark.parametrize("unit", ["Y", "y", "M"])
def test_unit_m_y_raises(self, unit):
msg = "Units 'M' and 'Y' are no longer supported"
msg = "Units 'M', 'Y', and 'y' are no longer supported"
with pytest.raises(ValueError, match=msg):
Timedelta(10, unit)

Expand Down