Skip to content

Commit 350202d

Browse files
committed
DEPR: Improve commenting around two deprecations
1 parent e817930 commit 350202d

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

pandas/_libs/tslibs/period.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3018,7 +3018,7 @@ class Period(_Period):
30183018
# GH#53446
30193019
import warnings
30203020

3021-
# TODO: Enforce in 3.0 (#53511)
3021+
# TODO: Need to find an alternative before this deprecation can be enforced (#53511)
30223022
from pandas.util._exceptions import find_stack_level
30233023
warnings.warn(
30243024
"Period with BDay freq is deprecated and will be removed "

pandas/core/generic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9136,7 +9136,8 @@ def resample(
91369136
from pandas.core.resample import get_resampler
91379137

91389138
if convention is not lib.no_default:
9139-
# TODO: Enforce in 3.0 (#55968)
9139+
# TODO: Plan to fix resampling with PeriodIndex instead (#55968)
9140+
# see https://github.com/pandas-dev/pandas/pull/62270#issuecomment-3262411892
91409141
warnings.warn(
91419142
f"The 'convention' keyword in {type(self).__name__}.resample is "
91429143
"deprecated and will be removed in a future version. "

pandas/core/resample.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,8 @@ class PeriodIndexResampler(DatetimeIndexResampler):
19451945

19461946
@property
19471947
def _resampler_for_grouping(self):
1948-
# TODO: Enforce in 3.0 (#55968)
1948+
# TODO: Plan to fix resampling with PeriodIndex instead (#55968)
1949+
# see https://github.com/pandas-dev/pandas/pull/62270#issuecomment-3262411892
19491950
warnings.warn(
19501951
"Resampling a groupby with a PeriodIndex is deprecated. "
19511952
"Cast to DatetimeIndex before resampling instead.",

pandas/tests/resample/test_base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ def test_resample_empty_dtypes(index, dtype, resample_method):
473473
warn = None
474474
if isinstance(index, PeriodIndex):
475475
# GH#53511
476+
# TODO: Need to find an alternative before this deprecation can be enforced
476477
index = PeriodIndex([], freq="B", name=index.name)
477478
warn = FutureWarning
478479
msg = "Resampling with a PeriodIndex is deprecated"

0 commit comments

Comments
 (0)