Merged
Conversation
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the conversion of input values to a Status enum by replacing calls to Status.from_str with a new Status.parse method.
- Updated tests in test_status.py to use Status.parse.
- Updated database retrieval functions in storage/sql/experiment.py and storage/sql/common.py to use Status.parse.
- Refactored the Status conversion logic in environments/status.py.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| mlos_bench/mlos_bench/tests/environments/test_status.py | Updated tests to use Status.parse instead of Status.from_str. |
| mlos_bench/mlos_bench/storage/sql/experiment.py | Replaced Status.from_str with Status.parse in trial loading. |
| mlos_bench/mlos_bench/storage/sql/common.py | Replaced Status.from_str with Status.parse for trial records. |
| mlos_bench/mlos_bench/environments/status.py | Renamed and refactored method converting different input types. |
3 tasks
bpkroth
commented
May 22, 2025
motus
approved these changes
Jun 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Title
Small refactor to
Status.parseDescription
Status.from_dict->Status.parseStatus.parseto accept aStatusas an argument and return it as is.(complete convenience for some python comprehension code elsewhere)
Type of Change
Testing
Small new CI check and existing tests.
Additional Notes (optional)
For convenience in another PR - #980