-
Notifications
You must be signed in to change notification settings - Fork 651
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
FIX-#4672: Fix incorrect warning when setting frame.columns or frame.index #4721
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4721 +/- ##
==========================================
- Coverage 85.13% 75.87% -9.27%
==========================================
Files 259 259
Lines 19211 19222 +11
==========================================
- Hits 16356 14584 -1772
- Misses 2855 4638 +1783
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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.
@jbrockmendel thank you so much for fixing this. I have a minor 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.
LGTM!
with pytest.warns(None): | ||
df.index = ["foo", "bar"] |
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.
pytest.warns(None)
doesn't check that we're not warning, so this test case doesn't reproduce the bug. The recommended solution is to use warnings.catch_warnings()
and warnings.simplefilter("error")
. I just checked that that reproduces the bug.
with pytest.warns(None): | |
df.index = ["foo", "bar"] | |
with warnings.catch_warnings(): | |
warnings.simplefilter("error") | |
df.index = ["foo", "bar"] |
You'll also have to import warnings
at the top of the file.
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.
could use pandas.testing.assert_produces_warning(None):
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 like assert_produces_warning
doesn't live in pandas.testing
anymore, and it was moved to pandas/_testing
. I guess we should use catch_warnings
after all.
…mns or frame index Signed-off-by: Brock <jbrockmendel@gmail.com>
…mns or frame index (modin-project#4721) Signed-off-by: Brock <jbrockmendel@gmail.com>
…index (#4721) Signed-off-by: Brock <jbrockmendel@gmail.com>
Signed-off-by: Brock jbrockmendel@gmail.com
What do these changes do?
Stop emitting incorrect warning.
flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
git commit -s
docs/development/architecture.rst
is up-to-date