jerryshao commented on code in PR #7133:
URL: https://github.com/apache/gravitino/pull/7133#discussion_r2081108466
##########
clients/client-python/gravitino/dto/requests/model_version_update_request.py:
##########
@@ -138,3 +138,48 @@ def model_version_change(self):
ModelVersionChange: The ModelVersionChange object representing
the update uri operation.
"""
return ModelVersionChange.update_uri(self._new_uri)
+
+ @dataclass
+ class ModelVersionAliasesRequest(ModelVersionUpdateRequestBase):
+ """Request to update model version aliases"""
+
+ _aliases_to_add: Optional[Set[str]] = field(
+ metadata=config(field_name="aliasesToAdd")
+ )
+ _aliases_to_remove: Optional[Set[str]] = field(
+ metadata=config(field_name="aliasesToRemove")
+ )
+
+ def __init__(self, add_aliases: Set[str], remove_aliases: Set[str]):
+ super().__init__("updateAliases")
+ self._aliases_to_add = add_aliases
+ self._aliases_to_remove = remove_aliases
+
+ def add_aliases(self):
+ """Retrieves the new aliases of the model version.
+ Returns:
+ The new aliases of the model version.
+ """
+ return self._add_aliases
+
+ def remove_aliases(self):
+ """Retrieves the new aliases of the model version.
+ Returns:
+ The new aliases of the model version.
+ """
+ return self._aliases_to_remove
+
+ def validate(self):
+ """Validates the fields of the request. Always pass."""
+ pass
Review Comment:
Do you need to verify the request?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]