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

DEPR: raise ValueError if invalid period freq pass to asfreq #56489

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

natmokval
Copy link
Contributor

xref #52064, #9586

in example:

index = pd.PeriodIndex(["2020-01-01", "2021-01-01"], freq="M")
df = pd.DataFrame({"a": pd.Series([0, 1], index=index)})
df.asfreq(freq=MonthBegin(2))

we silently convert " 2MS" to " 2M", which isn't correct.

Raised ValueError if invalid period freq pass to asfreq()

@natmokval natmokval marked this pull request as ready for review December 13, 2023 20:56
@natmokval natmokval added the Deprecate Functionality to remove in pandas label Dec 13, 2023
@MarcoGorelli MarcoGorelli added this to the 2.2 milestone Dec 14, 2023
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.

nice, well done noticing this

OK to not have whatsnew as the "silent conversion" isn't present in the latest release (only on main)

@MarcoGorelli MarcoGorelli merged commit 5f2abaa into pandas-dev:main Dec 14, 2023
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants