Skip to content

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

Open
@stephenpardy

Description

@stephenpardy

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:

  • install versin 0.3.0
  • run tests pytest --verbose --pyargs sklearn_extra -k 'not test_all_estimators'
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: 0f95d8d
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions