Skip to content

Commit be81a76

Browse files
authored
Fix TypeError of customized kfold method which needs 'y' (#1450)
1 parent 2d16089 commit be81a76

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
os: [ubuntu-latest, macos-latest, windows-2019]
38+
os: [ubuntu-latest, macos-latest, windows-latest]
3939
python-version: ["3.9", "3.10", "3.11"]
4040
steps:
4141
- uses: actions/checkout@v4
@@ -91,12 +91,12 @@ jobs:
9191
- name: Test with pytest
9292
if: matrix.python-version != '3.10'
9393
run: |
94-
pytest test/
94+
pytest test/ --ignore=test/autogen
9595
- name: Coverage
9696
if: matrix.python-version == '3.10'
9797
run: |
9898
pip install coverage
99-
coverage run -a -m pytest test
99+
coverage run -a -m pytest test --ignore=test/autogen
100100
coverage xml
101101
- name: Upload coverage to Codecov
102102
if: matrix.python-version == '3.10'

flaml/automl/task/generic_task.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,10 @@ def evaluate_model_CV(
746746
elif isinstance(kf, TimeSeriesSplit):
747747
kf = kf.split(X_train_split, y_train_split)
748748
else:
749-
kf = kf.split(X_train_split)
749+
try:
750+
kf = kf.split(X_train_split)
751+
except TypeError:
752+
kf = kf.split(X_train_split, y_train_split)
750753

751754
for train_index, val_index in kf:
752755
if shuffle:

0 commit comments

Comments
 (0)