Skip to content

TST:: Fixing pytest warning #50186

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

Closed
wants to merge 1 commit into from
Closed

Conversation

theoniko
Copy link
Contributor

@theoniko theoniko commented Dec 11, 2022

@@ -1449,6 +1449,8 @@ def test_loc_bool_multiindex(self, dtype, indexer):
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