Skip to content
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

DOC: Add note about deprecated offset aliases #58861

Merged
merged 1 commit into from
May 31, 2024

Conversation

tacaswell
Copy link
Contributor

The PRs #55792 (Y), #52064 (Q), and #55553 (M) deprecated the single letter version of the aliases in favour of the -end version of them.

This table was missed as part of that work.

I skipped making an issue because the PR with the fix is the simplest way to express the issue!

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

@MarcoGorelli
Copy link
Member

thanks @tacaswell

these are only deprecated for offsets (where people always interpreted 'M' to mean 'month' as opposed to 'month end')

for periods (the section you've edited), 'M' is still valid - periods have no "period start" / "period end"

is this not what you're seeing?

The PRs pandas-dev#55792 (Y), pandas-dev#52064 (Q), and pandas-dev#55553 (M) deprecated the single letter
version of the aliases in favour of the -end version of them.

Add a note to the offset table about deprecations.
@tacaswell
Copy link
Contributor Author

I'm getting this out of pd.Grouper(freq=...) which in my head should be "period", but reading the docs for pd.Grouper it does link to the offsets table so there is some user-error / wishful-API-usage (🐑 ) going on here. I went looking for notes on the deprecation, found the M in this table and decided to "help".

The warning I'm getting is:

<string>:23: FutureWarning: 'M' is deprecated and will be removed in a future version, please use 'ME' instead.

which is unclear if it is an offset or period (I don't have time to run through sorting out the deprecation note generation to tell if that is easy to add or not, sorry).


I've removed the changes to the table and moved the note to the other table.

@tacaswell tacaswell changed the title DOC: Do not list deprecated aliases in docs DOC: Add note about deprecated offset aliases May 29, 2024
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks @tacaswell , should be right - @natmokval could you confirm please?

@natmokval
Copy link
Contributor

thanks @tacaswell , should be right - @natmokval could you confirm please?

I agree, we should point out that we deprecated the aliases 'M,' 'Q,' etc., for offsets. Thanks, @tacaswell, for adding the note for the table with Offset aliases.

We can also mention in this note that we deprecated the aliases 'BM,' 'CBM,' 'BQ,' and 'BY' in favor of 'BME,' 'CBME,' 'BQE,' and 'BYE', but it’s already clear enough.

@MarcoGorelli MarcoGorelli added this to the 3.0 milestone May 31, 2024
@MarcoGorelli
Copy link
Member

agree, thanks for taking a look

cool, let's ship it then

@MarcoGorelli MarcoGorelli merged commit 5e97237 into pandas-dev:main May 31, 2024
22 checks passed
@tacaswell tacaswell deleted the doc/alias_deprecation branch May 31, 2024 17:47
@tacaswell tacaswell restored the doc/alias_deprecation branch June 7, 2024 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants