Skip to content

Fix test_no_optuna reinstalling optuna at wrong version#1522

Merged
thinkall merged 1 commit intomainfrom
li/fix_pipeline
Mar 5, 2026
Merged

Fix test_no_optuna reinstalling optuna at wrong version#1522
thinkall merged 1 commit intomainfrom
li/fix_pipeline

Conversation

@thinkall
Copy link
Collaborator

@thinkall thinkall commented Mar 5, 2026

Why are these changes needed?

The test_no_optuna() test in test/tune/test_searcher.py uninstalls optuna to verify graceful handling when it is missing, then reinstalls it. However, it was hardcoded to reinstall optuna==2.8.0 instead of using the version range specified elsewhere (>=2.8.0,<=3.6.1).

Since this test runs before the "Save dependencies" CI step, pip freeze captured the downgraded version, causing the saved dependency snapshot to incorrectly report optuna==2.8.0 instead of 3.6.1.

The fix changes the reinstall command from optuna==2.8.0 to optuna>=2.8.0,<=3.6.1 so the latest compatible version is restored after the test.

Related issue number

N/A

Checks

test_no_optuna() uninstalls optuna to test graceful handling, then
reinstalls it. It was hardcoded to reinstall optuna==2.8.0 instead of
the version range used elsewhere (>=2.8.0,<=3.6.1), leaving the test
environment with a downgraded optuna for the rest of the CI run. This
caused the saved dependency snapshot to incorrectly report optuna==2.8.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a CI/test environment issue in FLAML’s tuning test suite by ensuring test_no_optuna() restores Optuna using the same compatibility range declared in FLAML’s optional dependencies, preventing unintended dependency downgrades from being captured in CI snapshots.

Changes:

  • Update test_no_optuna() to reinstall Optuna using optuna>=2.8.0,<=3.6.1 instead of pinning optuna==2.8.0.

@thinkall thinkall merged commit a3a0764 into main Mar 5, 2026
20 checks passed
@thinkall thinkall deleted the li/fix_pipeline branch March 5, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants