GEOparse icon indicating copy to clipboard operation
GEOparse copied to clipboard

Fix failing tests: Add compatibility with pandas 2

Open olp-cs opened this issue 1 year ago • 0 comments

Closes #84

Compatibility with pandas 2

Problem:

For a pandas dataframe that contains both numeric and string columns, the mean() function started to fail in pandas 2.0+ because the default behavior has changed from mean(numeric_only=True) to mean(numeric_only=False) (link).

Solution:

Ensure we only have numeric columns.

Testing:

Compatibility with tox 4

1. Whitespace in the environmental variables

With tox==4.16.0, the tox command was failing with the following error:

py38: failed with pass_env values cannot contain whitespace, use comma to have multiple values in a single line, invalid values found 'GEOPARSE_USE_HTTP_FOR_FTP *_proxy *_PROXY USER'

The modified line also works in tox==3.14.3 (Dec 28, 2019). However, I couldn't run tox==3.13.0 (Jun 25, 2019) regardless of this line.

2. Explicit lxml dependency

Without the lxml dependency, 3 tests were failing:

FAILED test_GEOparse.py::TestGSM::test_download_SRA - ImportError: lxml not found, please install or use the etree parser.
FAILED test_GEOparse.py::TestGSM::test_download_SRA_parallel_by_gsm - ImportError: lxml not found, please install or use the etree parser.
FAILED test_GEOparse.py::TestGSM::test_download_SRA_parallel_by_sra - ImportError: lxml not found, please install or use the etree parser.
========================================================== 3 failed, 32 passed in 58.25s 

olp-cs avatar Jul 23 '24 13:07 olp-cs