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

The error message for unsupported index on shift() could be more explicit #38176

Merged
merged 16 commits into from
Dec 4, 2020

Conversation

ZhihuiChen0903
Copy link
Contributor

When the type of data index is not datetime-like, the following error message will raise:
NotImplementedError: Not supported for type Index

The error message could be more useful by explicitly stating which types of data that shift supports.

Expected error message:
f"This method is only implemented for DatetimeIndex, PeriodIndex and TimedeltaIndex; Got type {type(self).__name__}."

@pep8speaks
Copy link

pep8speaks commented Nov 30, 2020

Hello @ZhihuiChen0903! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-12-03 14:19:42 UTC

@jreback jreback added the Error Reporting Incorrect or improved errors from pandas label Dec 2, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

happy to have, we have tests that check the error message and need to be adjusted (have a look at CI logs for which ones).

@ZhihuiChen0903 ZhihuiChen0903 marked this pull request as draft December 3, 2020 11:21
@jreback jreback added this to the 1.2 milestone Dec 3, 2020
@jreback
Copy link
Contributor

jreback commented Dec 3, 2020

lgtm @ZhihuiChen0903 if you turnt his off draft can merge.

@ZhihuiChen0903 ZhihuiChen0903 marked this pull request as ready for review December 4, 2020 01:43
@ZhihuiChen0903
Copy link
Contributor Author

@jreback I have turned off draft.

@jreback jreback merged commit eeaf1a1 into pandas-dev:master Dec 4, 2020
@jreback
Copy link
Contributor

jreback commented Dec 4, 2020

thanks @ZhihuiChen0903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants