Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
rhshadrach wants to merge11 commits intopandas-dev:main
base:main
Choose a base branch
Loading
fromrhshadrach:implement_pdep17

Conversation

rhshadrach
Copy link
Member

@rhshadrachrhshadrach commentedMay 20, 2025
edited
Loading

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • Allcode checks passed.
  • Addedtype annotations to new arguments/methods/functions.
  • Added an entry in the latestdoc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Continuation of#58169

Still needs tests and some cleanup with the docs and decorator arguments, but I'd like to get a first look.

cc@Dr-Irv@Aloqeely

Comment on lines 94 to 97
classPandasChangeWarning(Warning):
"""
Warning raised for any an upcoming change.
"""
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not in love with this name, butPandasDeprecationWarning is taken below. Bikeshedding here is most welcome!

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We could also make this internal if we want to not have it be public.

@rhshadrachrhshadrach added this to the3.0 milestoneMay 20, 2025
@rhshadrachrhshadrach added Enhancement WarningsWarnings that appear or should be added to pandas PDEPpandas enhancement proposal labelsMay 20, 2025
@datapythonistadatapythonista removed the PDEPpandas enhancement proposal labelMay 20, 2025
@datapythonista
Copy link
Member

Seems like the labelPDEP can only be used for the PDEP themselves. Otherwise building the website fails, as it expects the PR to be a PDEP that needs to be rendered in the roadmap.

rhshadrach reacted with thumbs up emoji

Copy link
Contributor

@Dr-IrvDr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think there should be separate docs about the deprecation policy and these classes, aside from what is in the whatsnew document.

@rhshadrach
Copy link
MemberAuthor

@Dr-Irv - Thanks for the review! I'm negative on the namePandasWarning for a class that has to do with deprecations. pandas emits many warnings, not all are about deprecations.

@Dr-Irv
Copy link
Contributor

@Dr-Irv - Thanks for the review! I'm negative on the namePandasWarning for a class that has to do with deprecations. pandas emits many warnings, not all are about deprecations.

Maybe a different name would solve that? MaybePandasDeprecationOrFutureWarning or something like that.

@rhshadrach
Copy link
MemberAuthor

Maybe a different name would solve that? MaybePandasDeprecationOrFutureWarning or something like that.

Currently usingPandasChangeWarning, which has my personal preference so far. Always open to other options or opinions!

Dr-Irv reacted with thumbs up emoji

Copy link
Member

@AloqeelyAloqeely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for working on this!

@@ -91,6 +91,96 @@ class PerformanceWarning(Warning):
"""


class PandasChangeWarning(Warning):
"""
Warning raised for any an upcoming change.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
Warningraisedforanyanupcomingchange.
Warningraisedforanyupcomingchange.

Comment on lines 157 to 160

See Also
--------
errors.Pandas4Warning : Class for deprecations to be enforced in pandas 4.0.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
SeeAlso
--------
errors.Pandas4Warning :Classfordeprecationstobeenforcedinpandas4.0.

@@ -4,13 +4,16 @@

import inspect

from pandas.errors import Pandas4Warning
Copy link
Member

@AloqeelyAloqeelyMay 30, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Will this test case need to be updated every version? I think having a variable that points to the current version's warning might reduce some of the work.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Then that variable will just have to be updated instead, seems about the same amount of work to me.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I suppose if this is needed in multiple files, then it could become more of a hassle. Will add.

Aloqeely reacted with thumbs up emoji
@rhshadrach
Copy link
MemberAuthor

I think there should be separate docs about the deprecation policy and these classes, aside from what is in the whatsnew document.

I've added some implementation details to PDEP-17, and more details to the whatsnew. If you'd like to see this documented somewhere else, can you detail where.

Copy link
Contributor

@Dr-IrvDr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looking good!

@rhshadrachrhshadrach requested a review fromDr-IrvJune 4, 2025 00:42
@rhshadrach
Copy link
MemberAuthor

@bashtage - pandas_datareader is using thedeprecate_kwarg decorator. I'm modifying it here, is this an issue?

Copy link
Contributor

@Dr-IrvDr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm good with the current version. I'll let others decide when to merge.

Co-authored-by: Simon Hawkins <simonjayhawkins@gmail.com>
@rhshadrach
Copy link
MemberAuthor

@mroeschke - this should be ready.

- :class:`pandas.errors.Pandas5Warning`: Warnings which will be enforced in pandas 5.0.
- :class:`pandas.errors.PandasPendingDeprecationWarning`: Base class of all warnings which emit a ``PendingDeprecationWarning``, independent of the version they will be enforced.
- :class:`pandas.errors.PandasDeprecationWarning`: Base class of all warnings which emit a ``DeprecationWarning``, independent of the version they will be enforced.
- :class:`pandas.errors.PandasFutureWarning`: Base class of all warnings which emit a ``PandasFutureWarning``, independent of the version they will be enforced.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
-:class:`pandas.errors.PandasFutureWarning`: Base class of all warnings which emit a ``PandasFutureWarning``, independent of the version they will be enforced.
-:class:`pandas.errors.PandasFutureWarning`: Base class of all warnings which emit a ``FutureWarning``, independent of the version they will be enforced.

- :class:`pandas.errors.PandasChangeWarning`: Base class of all pandas deprecation warnings.
- :class:`pandas.errors.PandasPendingDeprecationWarning`: Base class of all warnings which emit a ``PendingDeprecationWarning``, independent of the version they will be enforced.
- :class:`pandas.errors.PandasDeprecationWarning`: Base class of all warnings which emit a ``DeprecationWarning``, independent of the version they will be enforced.
- :class:`pandas.errors.PandasFutureWarning`: Base class of all warnings which emit a ``PandasFutureWarning``, independent of the version they will be enforced.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
- :class:`pandas.errors.PandasFutureWarning`: Base class of all warnings which emit a``PandasFutureWarning``, independent of the version they will be enforced.
- :class:`pandas.errors.PandasFutureWarning`: Base class of all warnings which emit a``FutureWarning``, independent of the version they will be enforced.

mroeschke
mroeschke previously requested changesJul 15, 2025
Copy link
Member

@mroeschkemroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you think of a linting rule that could remind us to use these new warning classes instead ofFutureWarning andDeprecationWarning?

Copy link
Member

@mroeschkemroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you think of a linting rule that could remind us to use these new warning classes instead of FutureWarning and DeprecationWarning?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@mroeschkemroeschkemroeschke left review comments

@simonjayhawkinssimonjayhawkinssimonjayhawkins left review comments

@Dr-IrvDr-IrvDr-Irv approved these changes

@AloqeelyAloqeelyAwaiting requested review from Aloqeely

Assignees
No one assigned
Labels
EnhancementWarningsWarnings that appear or should be added to pandas
Projects
None yet
Milestone
3.0
Development

Successfully merging this pull request may close these issues.

6 participants
@rhshadrach@datapythonista@Dr-Irv@mroeschke@simonjayhawkins@Aloqeely

[8]ページ先頭

©2009-2025 Movatter.jp