-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
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
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 <william.ayd@icloud.com>
…_datetime_index_and_invalid_keys
thanks @fujiaxiang |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff