1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-11 23:06:58 +08:00

fix ci error (#1921)

* fix ci error

* fix ci error

* add comments

* add comments
This commit is contained in:
Linlang
2025-05-07 16:35:22 +08:00
committed by GitHub
parent 85cc74846b
commit be9cd9fe23
2 changed files with 11 additions and 1 deletions

View File

@@ -38,9 +38,13 @@ jobs:
run: | run: |
python -m pip install pywinpty --only-binary=:all: 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 - name: Qlib installation test
run: | run: |
python -m pip install pyqlib python -m pip install pyqlib
python -m pip install "joblib<=1.4.2"
- name: Install Lightgbm for MacOS - name: Install Lightgbm for MacOS
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-15' }} if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' || matrix.os == 'macos-15' }}

View File

@@ -6,6 +6,7 @@ from functools import partial
from threading import Thread from threading import Thread
from typing import Callable, Text, Union from typing import Callable, Text, Union
import joblib
from joblib import Parallel, delayed from joblib import Parallel, delayed
from joblib._parallel_backends import MultiprocessingBackend from joblib._parallel_backends import MultiprocessingBackend
import pandas as pd import pandas as pd
@@ -21,7 +22,12 @@ class ParallelExt(Parallel):
maxtasksperchild = kwargs.pop("maxtasksperchild", None) maxtasksperchild = kwargs.pop("maxtasksperchild", None)
super(ParallelExt, self).__init__(*args, **kwargs) super(ParallelExt, self).__init__(*args, **kwargs)
if isinstance(self._backend, MultiprocessingBackend): 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( def datetime_groupby_apply(