skrub-data/skrub

Scikit-learn v1.5 breaks skrub

Closed this issue · 4 comments

Describe the bug

My CI breaks due to skrub right now.


==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_titanic.py ____________________
ImportError while importing test module '/home/runner/work/scikit-playtime/scikit-playtime/tests/test_titanic.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_titanic.py:4: in <module>
    from playtime.formula import feats, onehot, bag_of_words
playtime/formula.py:9: in <module>
    from skrub import SelectCols
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/skrub/__init__.py:16: in <module>
    from ._similarity_encoder import SimilarityEncoder
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/skrub/_similarity_encoder.py:16: in <module>
    from sklearn.utils import parse_version
E   ImportError: cannot import name 'parse_version' from 'sklearn.utils' (/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/sklearn/utils/__init__.py)
=========================== short test summary info ============================
ERROR tests/test_titanic.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 1.27s ===============================

I can confirm locally that if you upgrade to sklearn 1.5 it breaks.

Steps/Code to Reproduce

from skrub._similarity_encoder import SimilarityEncoder

Expected Results

No error thrown.

Actual Results

See error above, it is the same.

Versions

Fun fact: that line of code no longer runs because of this issue ;)

But it's totally a sklearn version 1.5 thing. It smells like the function got moved.

Ah wait, I think it is already fixed on the main branch. In that case, can we maybe do a very small patch release with this fix? Otherwise, I believe it currently breaks when you run pip install scikit-learn skrub because you'll get the most recent versions.

yes I think this was fixed in #892
I think releasing just this patch is a good idea, otherwise as you say it's impossible to even import skrub

this should be fixed now, @koaning can you check that if you install the freshly-released version 0.1.1 it works?

The CI that was broken this morning seems all green now! Super!