Skip to content

Commit ae1928b

Browse files
committed
simplify test_asfreq_frequency_A_raises, add a note to 3.0.0, correct timeseries.rst
1 parent 4e6a49f commit ae1928b

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

doc/source/user_guide/timeseries.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1327,8 +1327,8 @@ frequencies. We will refer to these aliases as *period aliases*.
13271327

13281328
.. deprecated:: 2.2.0
13291329

1330-
Aliases ``A``, ``H``, ``T``, ``S``, ``L``, ``U``, and ``N`` are deprecated in favour of the aliases
1331-
``Y``, ``h``, ``min``, ``s``, ``ms``, ``us``, and ``ns``.
1330+
Aliases ``H``, ``T``, ``S``, ``L``, ``U``, and ``N`` are deprecated in favour of the aliases
1331+
``h``, ``min``, ``s``, ``ms``, ``us``, and ``ns``.
13321332

13331333

13341334
Combining aliases

doc/source/whatsnew/v3.0.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ Removal of prior version deprecations/changes
199199
- Changed the default value of ``observed`` in :meth:`DataFrame.groupby` and :meth:`Series.groupby` to ``True`` (:issue:`51811`)
200200
- Enforced deprecation disallowing parsing datetimes with mixed time zones unless user passes ``utc=True`` to :func:`to_datetime` (:issue:`57275`)
201201
- Enforced deprecation of ``axis=None`` acting the same as ``axis=0`` in the DataFrame reductions ``sum``, ``prod``, ``std``, ``var``, and ``sem``, passing ``axis=None`` will now reduce over both axes; this is particularly the case when doing e.g. ``numpy.sum(df)`` (:issue:`21597`)
202+
- Enforced deprecation of string ``A`` denoting frequency in :class:`YearEnd` and strings ``A-DEC``, ``A-JAN``, etc. denoting annual frequencies with various fiscal year ends (:issue:`57699`)
202203
- Enforced silent-downcasting deprecation for :ref:`all relevant methods <whatsnew_220.silent_downcasting>` (:issue:`54710`)
203204
- In :meth:`DataFrame.stack`, the default value of ``future_stack`` is now ``True``; specifying ``False`` will raise a ``FutureWarning`` (:issue:`55448`)
204205
- Methods ``apply``, ``agg``, and ``transform`` will no longer replace NumPy functions (e.g. ``np.sum``) and built-in functions (e.g. ``min``) with the equivalent pandas implementation; use string aliases (e.g. ``"sum"`` and ``"min"``) if you desire to use the pandas implementation (:issue:`53974`)

pandas/tests/frame/methods/test_asfreq.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,11 @@ def test_asfreq_unsupported_freq(self, freq, error_msg):
282282
with pytest.raises(ValueError, match=error_msg):
283283
df.asfreq(freq=freq)
284284

285-
@pytest.mark.parametrize(
286-
"freq, freq_depr",
287-
[
288-
("1YE", "1A"),
289-
("2YE-MAR", "2A-MAR"),
290-
],
291-
)
292-
def test_asfreq_frequency_A_raisees(self, freq, freq_depr):
293-
msg = f"Invalid frequency: {freq_depr[1:]}"
285+
def test_asfreq_frequency_A_raises(self):
286+
msg = "Invalid frequency: 2A"
294287

295-
index = date_range("1/1/2000", periods=4, freq=f"{freq[1:]}")
288+
index = date_range("1/1/2000", periods=4, freq="2ME")
296289
df = DataFrame({"s": Series([0.0, 1.0, 2.0, 3.0], index=index)})
297290

298291
with pytest.raises(ValueError, match=msg):
299-
df.asfreq(freq=freq_depr)
292+
df.asfreq(freq="2A")

0 commit comments

Comments
 (0)