From c481086ae5102d101523118579fb5c43cb9cd70b Mon Sep 17 00:00:00 2001 From: Li Jiang Date: Thu, 31 Jul 2025 12:02:42 +0800 Subject: [PATCH 1/4] Fix TypeError of customized kfold method which needs 'y' --- flaml/automl/task/generic_task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flaml/automl/task/generic_task.py b/flaml/automl/task/generic_task.py index e5c4513663..b4de64be27 100644 --- a/flaml/automl/task/generic_task.py +++ b/flaml/automl/task/generic_task.py @@ -746,7 +746,7 @@ def evaluate_model_CV( elif isinstance(kf, TimeSeriesSplit): kf = kf.split(X_train_split, y_train_split) else: - kf = kf.split(X_train_split) + kf = kf.split(X_train_split, y_train_split) for train_index, val_index in kf: if shuffle: From 2f8ef7aae7deb42a0a9b921bf815c9d45ef40304 Mon Sep 17 00:00:00 2001 From: Li Jiang Date: Thu, 31 Jul 2025 12:10:14 +0800 Subject: [PATCH 2/4] Update windows runner to the latest version --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7b02a9732e..ef7a0747c6 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-2019] + os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 From d69f4bdddbd6ad2cb1d98d6eb199f0c3f0e0eacf Mon Sep 17 00:00:00 2001 From: Li Jiang Date: Thu, 31 Jul 2025 14:58:32 +0800 Subject: [PATCH 3/4] Ignore autogen tests --- .github/workflows/python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ef7a0747c6..38b98ff3dd 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -91,12 +91,12 @@ jobs: - name: Test with pytest if: matrix.python-version != '3.10' run: | - pytest test/ + pytest test/ --ignore=test/autogen - name: Coverage if: matrix.python-version == '3.10' run: | pip install coverage - coverage run -a -m pytest test + coverage run -a -m pytest test --ignore=test/autogen coverage xml - name: Upload coverage to Codecov if: matrix.python-version == '3.10' From 5db4158a03967a90d58b9911f3315494195ea8e0 Mon Sep 17 00:00:00 2001 From: Li Jiang Date: Fri, 1 Aug 2025 11:25:54 +0800 Subject: [PATCH 4/4] Add try except for kf.split --- flaml/automl/task/generic_task.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flaml/automl/task/generic_task.py b/flaml/automl/task/generic_task.py index b4de64be27..5b74a3d755 100644 --- a/flaml/automl/task/generic_task.py +++ b/flaml/automl/task/generic_task.py @@ -746,7 +746,10 @@ def evaluate_model_CV( elif isinstance(kf, TimeSeriesSplit): kf = kf.split(X_train_split, y_train_split) else: - kf = kf.split(X_train_split, y_train_split) + try: + kf = kf.split(X_train_split) + except TypeError: + kf = kf.split(X_train_split, y_train_split) for train_index, val_index in kf: if shuffle: