Skip to content

Commit

Permalink
Pass ref to deprecate (#367)
Browse files Browse the repository at this point in the history
Allows to pass specific ref you want the deprecation tag to be attached
to
  • Loading branch information
aguschin authored Jun 8, 2023
1 parent 55bff02 commit 492f65f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gto/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def deregister(
def deprecate(
repo: Union[str, Repo],
name: str,
message: str = None,
ref: Optional[str] = None,
message: Optional[str] = None,
stdout: bool = False,
simple: Optional[bool] = None,
force: bool = False,
Expand All @@ -222,6 +223,7 @@ def deprecate(
with GitRegistry.from_repo(repo) as reg:
return reg.deprecate(
name=name,
ref=ref,
message=message,
stdout=stdout,
simple=simple,
Expand Down
4 changes: 4 additions & 0 deletions gto/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,9 @@ def deprecate(
name: str = arg_name,
version: str = Argument(None, help="Artifact version"),
stage: str = Argument(None, help="Stage to unassign"),
ref: Optional[str] = Option(
None, "--ref", help="Git reference to use (for model deprecation)"
),
message: Optional[str] = option_message,
simple: str = option_simple,
force: bool = option_force,
Expand Down Expand Up @@ -615,6 +618,7 @@ def deprecate(
gto.api.deprecate(
repo=repo,
name=name,
ref=ref,
message=message,
simple=simple, # type: ignore
force=force,
Expand Down

0 comments on commit 492f65f

Please sign in to comment.