gravitino.api.tag.tag_operations.TagOperations¶
- class gravitino.api.tag.tag_operations.TagOperations¶
Bases:
ABCInterface for supporting global tag operations. This interface will provide tag listing, getting, creating, and other tag operations under a metalake. This interface will be mixed with GravitinoMetalake or GravitinoClient to provide tag operations.
- __init__()¶
Methods
__init__()alter_tag(tag_name, *changes)Alter a tag under a metalake.
create_tag(tag_name, comment, properties)Create a new tag under a metalake.
delete_tag(tag_name)Delete a tag under a metalake.
get_tag(tag_name)Get a tag by its name under a metalake.
List all the tag names under a metalake.
List tags information under a metalake.
- abstract alter_tag(tag_name: str, *changes: TagChange) Tag¶
Alter a tag under a metalake.
- Args:
tag_name (str): The name of the tag. changes (TagChange): The changes to apply to the tag.
- Returns:
Tag: The altered tag.
- Raises:
NoSuchTagException: If the tag does not exist. NoSuchMetalakeException: If the metalake does not exist.
- abstract create_tag(tag_name: str, comment: str, properties: dict[str, str]) Tag¶
Create a new tag under a metalake.
- Raises:
NoSuchMetalakeException: If the metalake does not exist. TagAlreadyExistsException: If the tag already exists.
- Args:
tag_name (str): The name of the tag. comment (str): The comment of the tag. properties (dict[str, str]): The properties of the tag.
- Returns:
Tag: The tag information.
- abstract delete_tag(tag_name: str) bool¶
Delete a tag under a metalake.
- Args:
tag_name (str): The name of the tag.
- Returns:
bool: True if the tag was deleted, False otherwise.
- Raises:
NoSuchTagException: If the tag does not exist. NoSuchMetalakeException: If the metalake does not exist.
- abstract get_tag(tag_name: str) Tag¶
Get a tag by its name under a metalake.
- Args:
tag_name (str): The name of the tag.
- Returns:
Tag: The tag information.
- Raises:
NoSuchTagException: If the tag does not exist.
- abstract list_tags() list[str]¶
List all the tag names under a metalake.
- Returns:
list[str]: The list of tag names.
- Raises:
NoSuchMetalakeException: If the metalake does not exist.
- abstract list_tags_info() list[gravitino.api.tag.tag.Tag]¶
List tags information under a metalake.
- Returns:
list[Tag]: The list of tag information.
- Raises:
NoSuchMetalakeException: If the metalake does not exist.