diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 7b02a9732e..38b98ff3dd 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 @@ -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' diff --git a/flaml/automl/task/generic_task.py b/flaml/automl/task/generic_task.py index e5c4513663..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) + 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: