dandi / dandi-cli

DANDI command line client to facilitate common operations
https://dandi.readthedocs.io/
Apache License 2.0
22 stars 27 forks source link

Testing started to fail due to an error in parsing (?) + new deprecationwarning #1390

Closed yarikoptic closed 10 months ago

yarikoptic commented 10 months ago
Run python -m pytest -s -v --cov=dandi --cov-report=xml dandi
ERROR: while parsing the following warning configuration:

  ignore:.*Value with data type .* is being converted:hdmf.build.warnings.DtypeConversionWarning

This error occurred:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/_pytest/config/__init__.py", line [17](https://github.com/dandi/dandi-cli/actions/runs/7607121489/job/20713946745#step:7:18)61, in parse_warning_filter
Warning: ory: Type[Warning] = _resolve_warning_category(category_)
  File "/opt/hostedtoolcache/Python/3.9.[18](https://github.com/dandi/dandi-cli/actions/runs/7607121489/job/20713946745#step:7:19)/x64/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1799, in _resolve_warning_category
    m = __import__(module, None, None, [klass])
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/hdmf/__init__.py", line 2, in <module>
    from .backends.hdf5.h5_utils import H5Dataset, H5RegionSlicer
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/hdmf/backends/__init__.py", line 1, in <module>
    from . import hdf5
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/hdmf/backends/hdf5/__init__.py", line 1, in <module>
    from . import h5_utils, h5tools
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/hdmf/backends/hdf5/h5_utils.py", line 22, in <module>
    from ...region import RegionSlicer
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/hdmf/region.py", line 4, in <module>
    from .container import Data, DataRegion
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/hdmf/container.py", line 11, in <module>
    import pandas as pd
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pandas/__init__.py", line 2[21](https://github.com/dandi/dandi-cli/actions/runs/7607121489/job/20713946745#step:7:22), in <module>
    warnings.warn(
DeprecationWarning: 
Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),
(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)
but was not found to be installed on your system.
If this would cause problems for you,
please provide us feedback at https://github.com/pandas-dev/pandas/issues/5[44](https://github.com/dandi/dandi-cli/actions/runs/7607121489/job/20713946745#step:7:45)66

not sure why the first warning besides may be not allowing for a module spec hdmf.build.warnings. there? but without it doesn't work either -- may be a bug in pytest?

as for pyarrow -- if we do not rely on its functionality in the tests - I guess could be ignored too

jwodder commented 10 months ago

@yarikoptic The error is occurring because parsing the warnings filter ignore:.*Value with data type .* is being converted:hdmf.build.warnings.DtypeConversionWarning requires importing hdmf.build.warnings, and doing that causes pandas to be imported, triggering the deprecation warning.

yarikoptic commented 10 months ago

thank you!

github-actions[bot] commented 9 months ago

:rocket: Issue was released in 0.59.1 :rocket: