Skip to content

Commit

Permalink
Address the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryshao committed Dec 27, 2024
1 parent a29c243 commit dd78838
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions clients/client-python/gravitino/client/generic_model_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit dd78838

Please sign in to comment.