Skip to content

Conversation

@theoniko
Copy link
Contributor

@theoniko theoniko commented Dec 11, 2022

names=["a", "b"],
)
df = DataFrame({"c": [1, 2, 3, 4]}, index=midx)
df.sort_index()
Copy link
Member

Choose a reason for hiding this comment

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

This has no effect. What are you trying to do?

Copy link
Contributor Author

@theoniko theoniko Dec 11, 2022

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

sort_index returns a new object, as long as you ignore the new object, you will just continue operating on the unsorted object. In general, we don't want to call anything in tests that is not strictly necessary.

You have to understand where the warning is from. Then you can catch the warning or re-write the test so that the warning vanishes altogether. I guess that this is not possible here, but not sure.

@mroeschke
Copy link
Member

Thanks for the pull request, but I didn't notice this PR and addressed this already in #50354 and am working on this in #50386. Sorry for the overlap but going to close this PR for now, but happy to have your contribution on other issues

@mroeschke mroeschke closed this Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI/TST: Enable -W error:::pandas in pytest during CI runs

3 participants