-
Notifications
You must be signed in to change notification settings - Fork 159
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
refactor(BA-502): Add the skeleton interface of vfolder CRUD handlers in storage-proxy (#3434) #3516
base: main
Are you sure you want to change the base?
Conversation
Please check the reason for the CI failure as well. |
I made some changes before committing, but I found that I only ran |
class BaseModel(PydanticBaseModel): | ||
"""Base model for all models in this module""" | ||
|
||
model_config = {"arbitrary_types_allowed": True} |
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.
model_config = {"arbitrary_types_allowed": True} | |
model_config = ConfigDict(arbitrary_types_allowed = True) |
- How about using
pydantic.ConfigDict
? - Why is the config needed for all models in this module?
- Let's rename this class to
_BaseModel
to represent that it is private if it is used only in thistypes
module
|
||
# Common fields for VolumeID and VFolderID | ||
VOLUME_ID_FIELD = Field( | ||
..., |
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.
Why are those ellipsis used in pydantic field definition?
# For `get_vfolder_info`: mount | ||
subpath: Optional[PurePosixPath] = Field( | ||
default=None, | ||
description="For `get_vfolder_info`\n\ | ||
The subpath inside the virtual folder to be queried.", | ||
) | ||
# For `clone_vfolder` | ||
# You can use volume_id and vfolder_id as src_volume and src_vfolder_id. | ||
dst_vfolder_id: Optional[VFolderID] = Field( | ||
default=None, | ||
validation_alias=AliasChoices( | ||
"dst_vfid", | ||
"dstvfolderid", | ||
"dst_vfolder_id", | ||
"dstVfolderId", | ||
), | ||
description="For `clone_vfolder`\n\ | ||
The destination virtual folder ID to clone to.", | ||
) |
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.
I guess the models in this module are used to serialize and validate input of API handlers.
This VFolderIDModel
seems to be used in too many cases.
Let's divide this into separate models.
@@ -0,0 +1,3 @@ | |||
python_test_utils() |
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.
remove this.
resolves #3434 (BA-502)
Add skeletion interface of storage-proxy handlers for refactoring.
Files were added in ./src/ai/backend/storage/api/vfolder
[25-01-31] Updated with applying the feedback
manager_handler.py (updated)
manager_service.py(deleted)types.py (updated)
response_model.py (added)
conftest.py(deleted)test_handler.py (updated)
Checklist: (if applicable)
ai.backend.test
docs
directory