-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
BUG: Fix wrong error in df drop with non unique datetime index and invalid keys #30446
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
BUG: Fix wrong error in df drop with non unique datetime index and invalid keys #30446
Conversation
| # create dataframe with non-unique datetime index | ||
| df_nonunique = df_unique.copy().iloc[[0, 2, 2, 3]] | ||
|
|
||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the point of this is the raise a KeyError for the example specified - can you model the test to use pytest.raises instead? Should see other examples of this in the code base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have updated the code as requested. Now the test specifically expects KeyError with string "not found in axis" within the message
WillAyd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good minor nit on whatsnew - @jorisvandenbossche care to look?
Co-Authored-By: William Ayd <[email protected]>
…_datetime_index_and_invalid_keys
|
thanks @fujiaxiang |
black pandasgit diff upstream/master -u -- "*.py" | flake8 --diff