Skip to content

Commit 23bbfb8

Browse files
committed
Add CurrentDeprecationWarning
1 parent 740a8c2 commit 23bbfb8

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

pandas/tests/groupby/test_raises.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import numpy as np
99
import pytest
1010

11-
from pandas.util._exceptions import Pandas40DeprecationWarning
11+
from pandas.util._exceptions import CurrentDeprecationWarning
1212

1313
from pandas import (
1414
Categorical,
@@ -87,7 +87,7 @@ def df_with_cat_col():
8787

8888

8989
def _call_and_check(klass, msg, how, gb, groupby_func, args, warn_msg=""):
90-
warn_klass = None if warn_msg == "" else Pandas40DeprecationWarning
90+
warn_klass = None if warn_msg == "" else CurrentDeprecationWarning
9191
with tm.assert_produces_warning(warn_klass, match=warn_msg, check_stacklevel=False):
9292
if klass is None:
9393
if how == "method":

pandas/tests/util/test_pandas_deprecation_warning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import warnings
22

33
from pandas.util._decorators import deprecate_kwarg
4-
from pandas.util._exceptions import Pandas40DeprecationWarning
4+
from pandas.util._exceptions import CurrentDeprecationWarning
55

66
import pandas._testing as tm
77

88

99
def f1():
10-
warnings.warn("f1", Pandas40DeprecationWarning)
10+
warnings.warn("f1", CurrentDeprecationWarning)
1111

1212

1313
def test_function_warns_pandas_deprecation_warning():

pandas/util/_decorators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
T,
1818
)
1919
from pandas.util._exceptions import (
20-
Pandas40DeprecationWarning,
20+
CurrentDeprecationWarning,
2121
find_stack_level,
2222
)
2323

@@ -61,7 +61,7 @@ def deprecate(
6161
Default is '{name} is deprecated. Use {alt_name} instead.'
6262
"""
6363
alt_name = alt_name or alternative.__name__
64-
klass = klass or Pandas40DeprecationWarning
64+
klass = klass or CurrentDeprecationWarning
6565
warning_msg = msg or f"{name} is deprecated, use {alt_name} instead."
6666

6767
@wraps(alternative)
@@ -173,7 +173,7 @@ def deprecate_kwarg(
173173
raise TypeError(
174174
"mapping from old to new argument values must be dict or callable!"
175175
)
176-
klass = klass or Pandas40DeprecationWarning
176+
klass = klass or CurrentDeprecationWarning
177177

178178
def _deprecate_kwarg(func: F) -> F:
179179
@wraps(func)
@@ -300,7 +300,7 @@ def deprecate_nonkeyword_arguments(
300300
klass : Warning, optional
301301
The warning class to use.
302302
"""
303-
klass = klass or Pandas40DeprecationWarning
303+
klass = klass or CurrentDeprecationWarning
304304

305305
def decorate(func):
306306
old_sig = inspect.signature(func)

pandas/util/_exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
Pandas40DeprecationWarning = DeprecationWarning
1515
Pandas50DeprecationWarning = DeprecationWarning
16+
CurrentDeprecationWarning = Pandas40DeprecationWarning
1617

1718

1819
@contextlib.contextmanager

0 commit comments

Comments
 (0)