Skip to content

ENH: Implement PDEP-17 #61468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Aug 12, 2025
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
80edcb3
ENH: Implement PDEP-17
Aloqeely Apr 5, 2024
054398d
Refinements
rhshadrach May 20, 2025
4e46d69
Refinements
rhshadrach May 21, 2025
3f3293f
Fixup
rhshadrach May 21, 2025
cac0126
Merge branch 'main' of https://github.com/pandas-dev/pandas into impl…
rhshadrach Jun 2, 2025
638ca5b
Refinements
rhshadrach Jun 2, 2025
e2960b6
Add implementation details to PDEP-17
rhshadrach Jun 2, 2025
92a4e7e
API test fixup
rhshadrach Jun 2, 2025
6bca579
Refinements
rhshadrach Jun 4, 2025
3b9617d
Update doc/source/whatsnew/v3.0.0.rst
rhshadrach Jun 26, 2025
ae2c9ae
xfail pandas_datareader
rhshadrach Jul 13, 2025
087dba6
Update web/pandas/pdeps/0017-backwards-compatibility-and-deprecation-…
rhshadrach Jul 19, 2025
a6edff6
Merge branch 'main' into implement_pdep17
rhshadrach Jul 19, 2025
25405f2
Debug docs build
rhshadrach Jul 19, 2025
9df8b32
Revert
rhshadrach Jul 19, 2025
31b2460
Debug docs build
rhshadrach Jul 19, 2025
8e85f5c
Debug docs build
rhshadrach Jul 19, 2025
ce08582
Fixup & revert
rhshadrach Jul 21, 2025
f93374c
Merge branch 'main' of https://github.com/pandas-dev/pandas into impl…
rhshadrach Jul 21, 2025
1fcdd4a
Try removing file
rhshadrach Jul 21, 2025
ee3f4f2
Restore v0.23.0
rhshadrach Jul 27, 2025
871b88a
Merge branch 'main' of https://github.com/pandas-dev/pandas into impl…
rhshadrach Jul 27, 2025
dbb7e46
Cleanup v0.23.0.rst
rhshadrach Jul 27, 2025
f45b45a
Debug
rhshadrach Jul 27, 2025
d984c1c
Debug
rhshadrach Jul 27, 2025
a92650d
Debug
rhshadrach Jul 27, 2025
a034332
Debug
rhshadrach Jul 27, 2025
0b0a850
Debug
rhshadrach Jul 27, 2025
747f5ce
Debug
rhshadrach Jul 27, 2025
0b111fa
No whammies!
rhshadrach Jul 27, 2025
7273d4f
Finish up
rhshadrach Jul 27, 2025
0309448
Update doc/source/whatsnew/v3.0.0.rst
mroeschke Aug 4, 2025
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
Prev Previous commit
Next Next commit
Refinements
  • Loading branch information
rhshadrach committed Jun 4, 2025
commit 6bca579939e4005226c8ff45788caef50130c52c
30 changes: 25 additions & 5 deletions pandas/errors/__init__.py
Original file line number Diff line number Diff line change
@@ -98,7 +98,10 @@ class PandasChangeWarning(Warning):

See Also
--------
errors.Pandas4Warning : Class for deprecations to be enforced in pandas 4.0.
errors.PandasPendingDeprecationWarning : Class for deprecations that will raise a
PendingDeprecationWarning.
errors.PandasDeprecationWarning : Class for deprecations that will raise a
DeprecationWarning.
errors.PandasFutureWarning : Class for deprecations that will raise a FutureWarning.

Examples
@@ -119,7 +122,9 @@ class PandasPendingDeprecationWarning(PandasChangeWarning, PendingDeprecationWar

See Also
--------
errors.Pandas4Warning : Class for deprecations to be enforced in pandas 4.0.
errors.PandasChangeWarning: Class for deprecations that will raise any warning.
errors.PandasDeprecationWarning : Class for deprecations that will raise a
DeprecationWarning.
errors.PandasFutureWarning : Class for deprecations that will raise a FutureWarning.

Examples
@@ -135,7 +140,9 @@ class PandasDeprecationWarning(PandasChangeWarning, DeprecationWarning):

See Also
--------
errors.Pandas4Warning : Class for deprecations to be enforced in pandas 4.0.
errors.PandasChangeWarning: Class for deprecations that will raise any warning.
errors.PandasPendingDeprecationWarning : Class for deprecations that will raise a
PendingDeprecationWarning.
errors.PandasFutureWarning : Class for deprecations that will raise a FutureWarning.

Examples
@@ -151,7 +158,11 @@ class PandasFutureWarning(PandasChangeWarning, FutureWarning):

See Also
--------
errors.Pandas4Warning : Class for deprecations to be enforced in pandas 4.0.
errors.PandasChangeWarning: Class for deprecations that will raise any warning.
errors.PandasPendingDeprecationWarning : Class for deprecations that will raise a
PendingDeprecationWarning.
errors.PandasDeprecationWarning : Class for deprecations that will raise a
DeprecationWarning.

Examples
--------
@@ -166,6 +177,11 @@ class Pandas4Warning(PandasDeprecationWarning):

See Also
--------
errors.PandasChangeWarning: Class for deprecations that will raise any warning.
errors.PandasPendingDeprecationWarning : Class for deprecations that will raise a
PendingDeprecationWarning.
errors.PandasDeprecationWarning : Class for deprecations that will raise a
DeprecationWarning.
errors.PandasFutureWarning : Class for deprecations that will raise a FutureWarning.

Examples
@@ -186,7 +202,11 @@ class Pandas5Warning(PandasPendingDeprecationWarning):

See Also
--------
errors.Pandas4Warning : Class for deprecations to be enforced in pandas 4.0.
errors.PandasChangeWarning: Class for deprecations that will raise any warning.
errors.PandasPendingDeprecationWarning : Class for deprecations that will raise a
PendingDeprecationWarning.
errors.PandasDeprecationWarning : Class for deprecations that will raise a
DeprecationWarning.
errors.PandasFutureWarning : Class for deprecations that will raise a FutureWarning.

Examples
15 changes: 15 additions & 0 deletions pandas/tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -112,6 +112,21 @@ def test_AbstractMethodError_classmethod():
Foo().method()


@pytest.mark.parametrize(
"warn_category, catch_category",
[
(Pandas4Warning, PandasChangeWarning),
(Pandas4Warning, PandasDeprecationWarning),
(Pandas5Warning, PandasChangeWarning),
(Pandas5Warning, PandasPendingDeprecationWarning),
],
)
def test_pandas_warnings(warn_category, catch_category):
# https://github.com/pandas-dev/pandas/pull/61468
with tm.assert_produces_warning(catch_category):
warnings.warn("test", category=warn_category)


@pytest.mark.parametrize(
"warn_category, filter_category",
[
15 changes: 9 additions & 6 deletions pandas/tests/util/test_deprecate_nonkeyword_arguments.py
Original file line number Diff line number Diff line change
@@ -55,8 +55,8 @@ def test_four_arguments():

def test_three_arguments_with_name_in_warning():
msg = (
"Starting with pandas version 4.0 all arguments of f_add_inputs "
"except for the arguments 'a' and 'b' will be keyword-only."
f"Starting with pandas version {WARNING_CATEGORY.version()} all arguments of "
"f_add_inputs except for the arguments 'a' and 'b' will be keyword-only."
)
with tm.assert_produces_warning(WARNING_CATEGORY, match=msg):
assert f(6, 3, 3) == 12
@@ -84,7 +84,7 @@ def test_three_arguments_default_allowed_args():

def test_three_positional_argument_with_warning_message_analysis():
msg = (
"Starting with pandas version 4.0 all arguments of g "
f"Starting with pandas version {WARNING_CATEGORY.version()} all arguments of g "
"except for the argument 'a' will be keyword-only."
)
with tm.assert_produces_warning(WARNING_CATEGORY, match=msg):
@@ -111,7 +111,10 @@ def test_one_positional_argument():


def test_one_positional_argument_with_warning_message_analysis():
msg = "Starting with pandas version 4.0 all arguments of h will be keyword-only."
msg = (
f"Starting with pandas version {WARNING_CATEGORY.version()} all arguments "
"of h will be keyword-only."
)
with tm.assert_produces_warning(WARNING_CATEGORY, match=msg):
assert h(19) == 19

@@ -141,8 +144,8 @@ def test_foo_signature():

def test_class():
msg = (
r"Starting with pandas version 4.0 all arguments of Foo\.baz "
r"except for the argument \'bar\' will be keyword-only"
rf"Starting with pandas version {WARNING_CATEGORY.version()} all arguments "
r"of Foo\.baz except for the argument \'bar\' will be keyword-only"
)
with tm.assert_produces_warning(WARNING_CATEGORY, match=msg):
Foo().baz("qux", "quox")
25 changes: 0 additions & 25 deletions pandas/tests/util/test_pandas_deprecation_warning.py

This file was deleted.

Loading
Oops, something went wrong.