From dd78838bf1bf76782b699e89423f58db49025e28 Mon Sep 17 00:00:00 2001 From: Jerry Shao Date: Fri, 27 Dec 2024 19:56:54 +0800 Subject: [PATCH] Address the comments --- .../gravitino/client/generic_model_catalog.py | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/clients/client-python/gravitino/client/generic_model_catalog.py b/clients/client-python/gravitino/client/generic_model_catalog.py index f33a7e24dc4..c468f455dbd 100644 --- a/clients/client-python/gravitino/client/generic_model_catalog.py +++ b/clients/client-python/gravitino/client/generic_model_catalog.py @@ -33,7 +33,6 @@ from gravitino.dto.responses.model_response import ModelResponse from gravitino.dto.responses.model_version_list_response import ModelVersionListResponse from gravitino.dto.responses.model_vesion_response import ModelVersionResponse -from gravitino.exceptions.base import NoSuchModelException, NoSuchModelVersionException from gravitino.exceptions.handlers.model_error_handler import MODEL_ERROR_HANDLER from gravitino.namespace import Namespace from gravitino.rest.rest_utils import encode_string @@ -123,21 +122,6 @@ def get_model(self, ident: NameIdentifier) -> Model: return GenericModel(model_resp.model()) - def model_exists(self, ident: NameIdentifier) -> bool: - """Check if the model exists in the catalog. - - Args: - ident: The identifier of the model. - - Returns: - True if the model exists, false otherwise. - """ - try: - self.get_model(ident) - return True - except NoSuchModelException: - return False - def register_model( self, ident: NameIdentifier, comment: str, properties: Dict[str, str] ) -> Model: @@ -254,22 +238,6 @@ def get_model_version( return GenericModelVersion(model_version_resp.model_version()) - def model_version_exists(self, model_ident: NameIdentifier, version: int) -> bool: - """Check if the model version exists in the catalog. - - Args: - model_ident: The identifier of the model. - version: The version of the model. - - Returns: - True if the model version exists, false otherwise. - """ - try: - self.get_model_version(model_ident, version) - return True - except NoSuchModelVersionException: - return False - def get_model_version_by_alias( self, model_ident: NameIdentifier, alias: str ) -> ModelVersion: @@ -300,25 +268,6 @@ def get_model_version_by_alias( return GenericModelVersion(model_version_resp.model_version()) - def model_version_alias_exists( - self, model_ident: NameIdentifier, alias: str - ) -> bool: - """ - Check if the model version by alias exists in the catalog. - - Args: - model_ident: The identifier of the model. - alias: The alias of the model version. - - Returns: - True if the model version alias exists, false otherwise. - """ - try: - self.get_model_version_by_alias(model_ident, alias) - return True - except NoSuchModelVersionException: - return False - def link_model_version( self, model_ident: NameIdentifier,