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

ENH: raise TypeError if offsets which are not supported as period frequency pass to asfreq #56718

Closed
3 tasks done
natmokval opened this issue Jan 3, 2024 · 7 comments · Fixed by #56758
Closed
3 tasks done

Comments

@natmokval
Copy link
Contributor

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

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

Issue Description

In this case we get
AttributeError: 'pandas._libs.tslibs.offsets.MonthBegin' object has no attribute '_period_dtype_code'

Expected Behavior

the expected message should be
TypeError: MS is not supported as period frequency

Installed Versions

Replace this line with the output of pd.show_versions()

@natmokval natmokval added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 3, 2024
@natmokval natmokval self-assigned this Jan 3, 2024
@natmokval natmokval added Enhancement good first issue and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 3, 2024
@aram-cinnamon
Copy link
Contributor

take

@natmokval natmokval removed their assignment Jan 3, 2024
@dreamboxtech
Copy link

I can fix the issue. I would like to contribute.

@code-master-ajay
Copy link

can i take this ?

@natmokval
Copy link
Contributor Author

@dreamboxtech, @code-master-ajay, another contributor is currently working on this issue

@sabari906
Copy link

hello everyone .. im new to open source contributing i have one doubt if one person take a one issue in github another person can take to wrork same issue? different people work in same repo if i solve the issue can i send a merge pull request?

@MohitKumar020291
Copy link

hello everyone .. im new to open source contributing i have one doubt if one person take a one issue in github another person can take to wrork same issue? different people work in same repo if i solve the issue can i send a merge pull request?

Hello @sabari906. Yes you can. I will recommend you to read Code of Conduct. And if you have any doubts left, you can ask them on mailing groups. Thanks.

@MarcoGorelli
Copy link
Member

closed by #56945

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