Skip to content

Commit 19fd3b7

Browse files
authored
[HWORKS-1152] Add add_tag method + deprectation warning (logicalclocks#224)
1 parent d692024 commit 19fd3b7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Diff for: python/hsml/model.py

+23
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#
1616

1717
import json
18+
import warnings
1819
import humps
1920
from typing import Union, Optional
2021

@@ -427,6 +428,28 @@ def set_tag(self, name: str, value: Union[str, dict]):
427428
A tag consists of a <name,value> pair. Tag names are unique identifiers across the whole cluster.
428429
The value of a tag can be any valid json - primitives, arrays or json objects.
429430
431+
!!! warning
432+
This method is deprecated and will be remove in 4.0, please use `add_tag` instead.
433+
434+
# Arguments
435+
name: Name of the tag to be added.
436+
value: Value of the tag to be added.
437+
# Raises
438+
`RestAPIError` in case the backend fails to add the tag.
439+
"""
440+
warnings.warn(
441+
"Using set_tag is deprecated, please use add_tag instead.",
442+
DeprecationWarning,
443+
stacklevel=1,
444+
)
445+
self._model_engine.set_tag(self, name, value)
446+
447+
def add_tag(self, name: str, value: Union[str, dict]) -> None:
448+
"""Attach a tag to a model.
449+
450+
A tag consists of a <name,value> pair. Tag names are unique identifiers across the whole cluster.
451+
The value of a tag can be any valid json - primitives, arrays or json objects.
452+
430453
# Arguments
431454
name: Name of the tag to be added.
432455
value: Value of the tag to be added.

0 commit comments

Comments
 (0)