Skip to content
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

Ignore pandas pyarrow warning #6609

Merged
merged 7 commits into from Jan 22, 2024
Merged

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Jan 21, 2024

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 https://github.com/pandas-dev/pandas/issues/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.

@Czaki Czaki added the maintenance PR with maintance changes, label Jan 21, 2024
@Czaki Czaki added this to the 0.4.19 milestone Jan 21, 2024
Copy link

codecov bot commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3c58ab4) 92.27% compared to head (b14caff) 92.22%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6609      +/-   ##
==========================================
- Coverage   92.27%   92.22%   -0.05%     
==========================================
  Files         603      603              
  Lines       53902    53933      +31     
==========================================
+ Hits        49736    49742       +6     
- Misses       4166     4191      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pyproject.toml Outdated Show resolved Hide resolved
Czaki and others added 2 commits January 22, 2024 08:46
Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Copy link
Contributor

@brisvag brisvag left a comment

Choose a reason for hiding this comment

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

LGTM!

pyproject.toml Outdated Show resolved Hide resolved
Czaki and others added 3 commits January 22, 2024 13:52
Co-authored-by: Lorenzo Gaifas <brisvag@gmail.com>
@brisvag
Copy link
Contributor

brisvag commented Jan 22, 2024

Can you explain the new syntax here for posterity?

@Czaki
Copy link
Collaborator Author

Czaki commented Jan 22, 2024

This PR is using (?s) flag documented in https://docs.python.org/3/library/re.html#re.DOTALL that is passing re.DOTALL flag in regexp.

@brisvag brisvag added the ready to merge Last chance for comments! Will be merged in ~24h label Jan 22, 2024
@Czaki Czaki merged commit 41dcb89 into napari:main Jan 22, 2024
34 checks passed
@Czaki Czaki deleted the filter_pandas_warning branch January 22, 2024 16:14
@Czaki Czaki removed the ready to merge Last chance for comments! Will be merged in ~24h label Jan 22, 2024
Czaki added a commit that referenced this pull request Jan 23, 2024
# 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 <76622105+psobolewskiPhD@users.noreply.github.com>
Co-authored-by: Lorenzo Gaifas <brisvag@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance PR with maintance changes,
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants