simplify test_asfreq_frequency_A_raises, add a note to 3.0.0, correct… · pandas-dev/pandas@ae1928b (original) (raw)
3 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1327,8 +1327,8 @@ frequencies. We will refer to these aliases as *period aliases*. | ||
1327 | 1327 | |
1328 | 1328 | .. deprecated:: 2.2.0 |
1329 | 1329 | |
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``. | |
1332 | 1332 | |
1333 | 1333 | |
1334 | 1334 | Combining aliases |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -199,6 +199,7 @@ Removal of prior version deprecations/changes | ||
199 | 199 | - Changed the default value of ``observed`` in :meth:`DataFrame.groupby` and :meth:`Series.groupby` to ``True`` (:issue:`51811`) |
200 | 200 | - Enforced deprecation disallowing parsing datetimes with mixed time zones unless user passes ``utc=True`` to :func:`to_datetime` (:issue:`57275`) |
201 | 201 | - 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`) | |
202 | 203 | - Enforced silent-downcasting deprecation for :ref:`all relevant methods <whatsnew_220.silent_downcasting>` (:issue:`54710`) |
203 | 204 | - In :meth:`DataFrame.stack`, the default value of ``future_stack`` is now ``True``; specifying ``False`` will raise a ``FutureWarning`` (:issue:`55448`) |
204 | 205 | - 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`) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -282,18 +282,11 @@ def test_asfreq_unsupported_freq(self, freq, error_msg): | ||
282 | 282 | with pytest.raises(ValueError, match=error_msg): |
283 | 283 | df.asfreq(freq=freq) |
284 | 284 | |
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" | |
294 | 287 | |
295 | -index = date_range("1/1/2000", periods=4, freq=f"{freq[1:]}") | |
288 | +index = date_range("1/1/2000", periods=4, freq="2ME") | |
296 | 289 | df = DataFrame({"s": Series([0.0, 1.0, 2.0, 3.0], index=index)}) |
297 | 290 | |
298 | 291 | with pytest.raises(ValueError, match=msg): |
299 | -df.asfreq(freq=freq_depr) | |
292 | +df.asfreq(freq="2A") |