-
Notifications
You must be signed in to change notification settings - Fork 142
feat(openapi): add exp state api #963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+83
−5
Conversation
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
kites262
requested changes
May 7, 2025
kites262
reviewed
May 7, 2025
可以合并下自动处理异常的代码, |
There was a problem hiding this 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 introduces a new API endpoint to retrieve experiment status and adds corresponding unit tests.
- Exposes three parameters for the experiment status API call.
- Adds a new method get_exp_state in OpenApi that delegates to ExperimentAPI.
- Introduces unit tests to verify handling of both successful status responses and error (404) conditions.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
test/unit/api/openapi/test_experiment.py | Adds a unit test exercising the new exp state retrieval API. |
swanlab/api/openapi/main.py | Introduces get_exp_state in OpenApi with optional workspace use. |
swanlab/api/openapi/experiment.py | Implements experiment state retrieval with basic empty-check. |
Comments suppressed due to low confidence (1)
swanlab/api/openapi/main.py:71
- [nitpick] Consider aligning the parameter naming between OpenApi.get_exp_state and ExperimentAPI.get_exp_state (using 'expid' vs 'exp_cuid') for consistency across the API.
def get_exp_state(self, project: str, exp_cuid: str, workspace: Optional[str] = None):
SAKURA-CAT
added a commit
that referenced
this pull request
May 12, 2025
* feat(openapi): list workspaces (#961) * feat(openapi): list workspaces * refa(openapi): login logic * docs(openapi): revise * fix(test): no cloud * feat(openapi): auto catch ApiError * Add `get_exp_state` for OpenAPI Add `get_exp_state` for OpenAPI (#963) --------- Co-authored-by: kites262 <kites262@qq.com> * feat(openapi): get experiment (#964) * feature: get experiment * fix some * feat(openapi): get project exps * feat(openapi): types * fix: py<3.8 * refa(openapi): types for ide * feat(openapi): list projects (#966) * feat(openapi): list project * refactor(openapi): list projects with apiresponse type * refactor(openapi): rewrite list comprehension * fix: typo * refa(openapi): general fetch paginated api * fix(openapi): test & default value --------- Co-authored-by: kites262 <kites262@qq.com> * chore: fix desc & comment --------- Co-authored-by: hyYY-1024 <75209465+hyYY-1024@users.noreply.github.com> Co-authored-by: Kaikai <98205900+Kaikaikaifang@users.noreply.github.com> Co-authored-by: CaddiesNew <50736785+Nexisato@users.noreply.github.com>
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.
Description
获取一个exp状态,将三个参数都暴露出去让用户填写。第一次接触这个项目,如有开发不符请及时联系我,谢谢
🎯 PRs Should Target Issues
开发openapis