Skip to content

Commit

Permalink
assert_fullname_is_valid instead of check_args
Browse files Browse the repository at this point in the history
  • Loading branch information
tapadipti committed Oct 13, 2023
1 parent 9e3c3f3 commit 1ddc807
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gto/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ def deprecate(
author: Optional[str] = None,
author_email: Optional[str] = None,
) -> Optional[Deprecation]:
self._check_args(name=name, version=None, rev=rev, deprecate_model=True)
"""Deprecate artifact"""
assert_fullname_is_valid(name)
if force:
if simple:
raise WrongArgs("Can't use 'force' with 'simple=True'")
Expand Down Expand Up @@ -461,13 +462,13 @@ def deprecate(
)
return self._return_event(tag)

def _check_args(self, name, version, rev, stage=None, deprecate_model=False):
def _check_args(self, name, version, rev, stage=None):
assert_fullname_is_valid(name)
if stage is not None:
self.config.assert_stage(stage)
if version:
self._check_version(version)
if not deprecate_model and not (version is None) ^ (rev is None):
if not (version is None) ^ (rev is None):
raise WrongArgs("One and only one of (version, rev) must be specified.")

@staticmethod
Expand Down

0 comments on commit 1ddc807

Please sign in to comment.