Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test_qlib_from_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ jobs:
run: |
python -m pip install pywinpty --only-binary=:all:

# # joblib was released on 2025-05-04 with version 1.5.0, in which _backend_args was removed and replaced by _backend_kwargs.
# This change caused the application to fail, so the version of joblib is restricted here.
# This restriction will be removed in the next release. The current qlib version is: 0.9.6
- name: Qlib installation test
run: |
python -m pip install pyqlib
python -m pip install "joblib<=1.4.2"

- name: Install Lightgbm for MacOS
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-15' }}
Expand Down
8 changes: 7 additions & 1 deletion qlib/utils/paral.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from threading import Thread
from typing import Callable, Text, Union

import joblib
from joblib import Parallel, delayed
from joblib._parallel_backends import MultiprocessingBackend
import pandas as pd
Expand All @@ -21,7 +22,12 @@ def __init__(self, *args, **kwargs):
maxtasksperchild = kwargs.pop("maxtasksperchild", None)
super(ParallelExt, self).__init__(*args, **kwargs)
if isinstance(self._backend, MultiprocessingBackend):
self._backend_args["maxtasksperchild"] = maxtasksperchild
# 2025-05-04 joblib released version 1.5.0, in which _backend_args was removed and replaced by _backend_kwargs.
# Ref: https://github.com/joblib/joblib/pull/1525/files#diff-e4dff8042ce45b443faf49605b75a58df35b8c195978d4a57f4afa695b406bdc
if joblib.__version__ < "1.5.0":
self._backend_args["maxtasksperchild"] = maxtasksperchild # pylint: disable=E1101
else:
self._backend_kwargs["maxtasksperchild"] = maxtasksperchild # pylint: disable=E1101


def datetime_groupby_apply(
Expand Down
Loading