-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Remove enter on begin of warnign message #57003
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
Conversation
Numpy failure looks unrelated |
# Description The #6608 shows that new pandas warning crash our tests. ``` /tmp/.tox/py39-linux-pyqt5/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:186: in exec_module exec(co, module.__dict__) napari/layers/base/base.py:28: in <module> from napari.layers.utils.layer_utils import ( <frozen importlib._bootstrap>:1007: in _find_and_load ??? <frozen importlib._bootstrap>:986: in _find_and_load_unlocked ??? <frozen importlib._bootstrap>:680: in _load_unlocked ??? /tmp/.tox/py39-linux-pyqt5/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:186: in exec_module exec(co, module.__dict__) napari/layers/utils/layer_utils.py:10: in <module> import pandas as pd /tmp/.tox/py39-linux-pyqt5/lib/python3.9/site-packages/pandas/__init__.py:221: in <module> warnings.warn( E DeprecationWarning: E Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0), E (to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries) E but was not found to be installed on your system. E If this would cause problems for you, E please provide us feedback at pandas-dev/pandas#54466 ``` This PR adds filter warnings to prevent this failure. Because warnings start with an empty line, this fix is fragile and heavily depends on the order of imports. Pull request to fix warning message in pandas pandas-dev/pandas#57003 cPython issue: python/cpython#114426 This PR also fixes usage of chained assignment. --------- Co-authored-by: Peter Sobolewski <[email protected]> Co-authored-by: Lorenzo Gaifas <[email protected]>
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 @lithomas1
# Description The #6608 shows that new pandas warning crash our tests. ``` /tmp/.tox/py39-linux-pyqt5/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:186: in exec_module exec(co, module.__dict__) napari/layers/base/base.py:28: in <module> from napari.layers.utils.layer_utils import ( <frozen importlib._bootstrap>:1007: in _find_and_load ??? <frozen importlib._bootstrap>:986: in _find_and_load_unlocked ??? <frozen importlib._bootstrap>:680: in _load_unlocked ??? /tmp/.tox/py39-linux-pyqt5/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:186: in exec_module exec(co, module.__dict__) napari/layers/utils/layer_utils.py:10: in <module> import pandas as pd /tmp/.tox/py39-linux-pyqt5/lib/python3.9/site-packages/pandas/__init__.py:221: in <module> warnings.warn( E DeprecationWarning: E Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0), E (to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries) E but was not found to be installed on your system. E If this would cause problems for you, E please provide us feedback at pandas-dev/pandas#54466 ``` This PR adds filter warnings to prevent this failure. Because warnings start with an empty line, this fix is fragile and heavily depends on the order of imports. Pull request to fix warning message in pandas pandas-dev/pandas#57003 cPython issue: python/cpython#114426 This PR also fixes usage of chained assignment. --------- Co-authored-by: Peter Sobolewski <[email protected]> Co-authored-by: Lorenzo Gaifas <[email protected]>
Let's hold on this for now, since we might just revert the deprecation entirely for 2.2.1. |
Please consider my comment for the PR, thanks. |
Pandas 2.2.0 raises an annoying warning upon import that cannot be ignored when running pytest. See pandas-dev/pandas#57003
Thanks for the start here but the warning ended up getting removed in #57556 so closing |
Closes #57082
With current code, it is not possible to filter pandas warning about PyArrow that leads to crash of test suite with the rule to treat warning as error.
It looks like the source of the problem is that
warnigns
library compile pattern with only IgnoreCase flag.https://github.com/python/cpython/blob/d1b031cc58516e1aba823fd613528417a996f50d/Lib/warnings.py#L160
And then is using
match
instead ofsearch
so it matches to initial line.With this change, it this warning will be possible to ignore this using:
In napari we meet it here: napari/napari#6609
cPython issue about problem with empty line python/cpython#114426