-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ENH: Allow performance warnings to be disabled #56921
ENH: Allow performance warnings to be disabled #56921
Conversation
…ach/pandas into enh_options_perf_warning � Conflicts: � doc/source/whatsnew/v3.0.0.rst � pandas/core/config_init.py � pandas/core/indexes/multi.py � pandas/core/internals/managers.py � pandas/core/reshape/reshape.py � pandas/io/pytables.py
…options_perf_warning � Conflicts: � doc/source/whatsnew/v3.0.0.rst � pandas/core/internals/managers.py � pandas/tests/frame/indexing/test_indexing.py � pandas/tests/frame/indexing/test_insert.py � pandas/tests/frame/test_block_internals.py
For the test fixture, I wanted to be able to pass it directly to
|
msg = "Falling back on a non-pyarrow code path which may decrease performance." | ||
if version is not None: | ||
msg += f" Upgrade to pyarrow >={version} to possibly suppress this warning." | ||
warnings.warn(msg, PerformanceWarning, stacklevel=find_stack_level()) |
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.
Going forward how can we ensure that PerformanceWarning
s are not issued without checking the option?
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.
We currently fail if a warning is emitted in a test outside of tm.assert_produces_warning
.
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.
True, as long as we have a test for it :)
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
…rning # Conflicts: # pandas/core/internals/managers.py
…rning # Conflicts: # doc/source/whatsnew/v3.0.0.rst
…rning # Conflicts: # pandas/conftest.py
@mroeschke - should be good to merge. |
Thanks @rhshadrach |
Late feedback, but was thinking about this in the context of #58581, but it would make sense to change the default to something like |
That behavior sounds like an improvement to me, but I'd still prefer #55385 over it. Maybe discuss this alternative there? Would be good to have a list of performance warnings we'd want on by default (I'd guess we'd start with whatever warnings we have now, but that might not be the same as want we want to end up with). |
* ENH: Allow performance warnings to be disabled * ENH: Allow performance warnings to be disabled * Add tests * fixup
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This still needs tests - I plan to add tests for disabling the warnings wherever we currently hit a PerformanceWarning in the test suite. But I'd like to get feedback on the linked issue first.Tests added.