Skip to content

Commit

Permalink
[HWORKS-1152] Add add_tag method + deprectation warning (logicalclock…
Browse files Browse the repository at this point in the history
  • Loading branch information
vatj authored Apr 18, 2024
1 parent d692024 commit 19fd3b7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions python/hsml/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#

import json
import warnings
import humps
from typing import Union, Optional

Expand Down Expand Up @@ -427,6 +428,28 @@ def set_tag(self, name: str, value: Union[str, dict]):
A tag consists of a <name,value> pair. Tag names are unique identifiers across the whole cluster.
The value of a tag can be any valid json - primitives, arrays or json objects.
!!! warning
This method is deprecated and will be remove in 4.0, please use `add_tag` instead.
# Arguments
name: Name of the tag to be added.
value: Value of the tag to be added.
# Raises
`RestAPIError` in case the backend fails to add the tag.
"""
warnings.warn(
"Using set_tag is deprecated, please use add_tag instead.",
DeprecationWarning,
stacklevel=1,
)
self._model_engine.set_tag(self, name, value)

def add_tag(self, name: str, value: Union[str, dict]) -> None:
"""Attach a tag to a model.
A tag consists of a <name,value> pair. Tag names are unique identifiers across the whole cluster.
The value of a tag can be any valid json - primitives, arrays or json objects.
# Arguments
name: Name of the tag to be added.
value: Value of the tag to be added.
Expand Down

0 comments on commit 19fd3b7

Please sign in to comment.