Skip to content

Refactor Status.parse#982

Merged
motus merged 8 commits intomicrosoft:mainfrom
bpkroth:refactor/parse-status
Jun 12, 2025
Merged

Refactor Status.parse#982
motus merged 8 commits intomicrosoft:mainfrom
bpkroth:refactor/parse-status

Conversation

@bpkroth
Copy link
Copy Markdown
Collaborator

@bpkroth bpkroth commented May 22, 2025

Pull Request

Title

Small refactor to Status.parse


Description

  • Rename Status.from_dict -> Status.parse
  • Allow Status.parse to accept a Status as an argument and return it as is.
    (complete convenience for some python comprehension code elsewhere)
  • Add a test for that.

Type of Change

  • 🔄 Refactor

Testing

Small new CI check and existing tests.


Additional Notes (optional)

For convenience in another PR - #980


Copilot AI review requested due to automatic review settings May 22, 2025 04:50
@bpkroth bpkroth requested a review from a team as a code owner May 22, 2025 04:50
Copy link
Copy Markdown
Contributor

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 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.

@motus motus enabled auto-merge (squash) June 12, 2025 01:14
@motus motus merged commit 869001b into microsoft:main Jun 12, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants