scikit-learn-contrib / scikit-learn-extra

scikit-learn contrib estimators
https://scikit-learn-extra.readthedocs.io
BSD 3-Clause "New" or "Revised" License
185 stars 42 forks source link

Version 0.3.0 fails tests due to deprecated scikit-learn functionality. #171

Open stephenpardy opened 5 months ago

stephenpardy commented 5 months ago

The latest release, 0.3.0 fails some tests due to the use of if_delegate_has_method which was removed from sklearn in version 1.3.

Steps:

ERROR sklearn_extra/robust/__init__.py - ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators' (<PATH>/sklearn-extra/lib/python3.10/site-packages/sklearn/utils/metaestimators.py)
ERROR sklearn_extra/robust/mean_estimators.py - ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators' (<PATH>/sklearn-extra/lib/python3.10/site-packages/sklearn/utils/metaestimators.py)
ERROR sklearn_extra/robust/robust_weighted_estimator.py - ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators' (<PATH>/sklearn-extra/lib/python3.10/site-packages/sklearn/utils/metaestimators.py)
ERROR sklearn_extra/robust/tests/test_mean_estimators.py - ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators' (<PATH>/sklearn-extra/lib/python3.10/site-packages/sklearn/utils/metaestimators.py)
ERROR sklearn_extra/robust/tests/test_mean_estimators.py
ERROR sklearn_extra/robust/tests/test_robust_weighted_estimator.py - ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators' (<PATH>/sklearn-extra/lib/python3.10/site-packages/sklearn/utils/metaestimators.py)
ERROR sklearn_extra/robust/tests/test_robust_weighted_estimator.py
ERROR sklearn_extra/tests/test_common.py - ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators' (<PATH>/sklearn-extra/lib/python3.10/site-packages/sklearn/utils/metaestimators.py)
ERROR sklearn_extra/tests/test_common.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 9 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

This has already been fixed in a recent PR: https://github.com/scikit-learn-contrib/scikit-learn-extra/commit/0f95d8dda4c69f9de4fb002366041adcb1302f3b So we would just need to cut a new release. Alternatively you could cut a bugfix release for version 0.3.0 that pinned the dependencies with an upper pin.