Fix dependency: Joblib 1.4.0 breaks PyCaret, so vendorize compatibility routines #3965
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
PyCaret uses the private function
joblib.memory._format_load_msg
from Joblib, which is no longer present in Joblib 1.4.Solution
In order to fix the problem without much efforts, this patch vendorizes the corresponding function from Joblib without much ado.
Evaluation
It is advisable to release this update on behalf of a bugfix release, so that downstream users will get this issue resolved quickly.
Install
In order to use the patch instantly before upstream maintainers ran a new bugfix release, if it's important to you, you may want to use this pip package specification to install the package in an ad hoc manner, including the fixes for both dependency flaws.
pip install --upgrade 'pycaret[parallel] @ git+https://github.com/crate-workbench/pycaret@fix-joblib-vendorize'
It also works within package metadata specifications like setup.py, setup.cfg, pyproject.toml, or requirements.txt files, with recent versions of pip, when the git command is available on the installation environment. This satisfies most workstation installations, the Google Colab runtime environment, and probably a few others where git is provided.
Trivia
Please note this patch is not sufficient to make PyCaret work on Python 3.11.9, which also has been released recently 1, and introduces another incompatibility. You will additionally need that patch to make it work:
However, this does not impact users who did not update their Python 3.11 version yet, and others who might still be on Python 3.10 or earlier.
Footnotes
That's the reason why CI still fails, see [META]: Joblib 1.4.0 breaks PyCaret. Python 3.11.9 breaks Dask. #3966, which summarizes both issues. ↩