gravitino.client.generic_tag.GenericTag

class gravitino.client.generic_tag.GenericTag(metalake: str, tag_dto: TagDTO, client: HTTPClient)

Bases: Tag, AssociatedObjects

Represents a generic tag.

__init__(metalake: str, tag_dto: TagDTO, client: HTTPClient) None

Methods

__init__(metalake, tag_dto, client)

associated_objects()

The associated objects of the tag.

audit_info()

Retrieve the audit information of the entity.

comment()

Get the comment of the tag.

count()

Retrieve the number of objects that are associated with this Tag

get_response(url, error_handler)

Get the response from the server, for testing convenience.

inherited()

Check if the tag is inherited from a parent object or not.

name()

Get the name of the tag.

objects()

Retrieve the list of objects that are associated with this tag.

properties()

Get the properties of the tag.

Attributes

API_LIST_OBJECTS_ENDPOINT

PROPERTY_COLOR

A reserved property to specify the color of the tag.

class AssociatedObjects

Bases: ABC

The interface of the associated objects of the tag.

count() int

Retrieve the number of objects that are associated with this Tag

Returns:

int: The number of objects that are associated with this Tag

abstract objects() list[gravitino.api.metadata_object.MetadataObject]

Retrieve the list of objects that are associated with this tag.

Raises:

NotImplementedError: if the method is not implemented.

Returns:

list[MetadataObject]: The list of objects that are associated with this tag.

PROPERTY_COLOR: ClassVar[str] = 'color'

A reserved property to specify the color of the tag. The color is a string of hex code that represents the color of the tag. The color is used to visually distinguish the tag from other tags.

associated_objects() AssociatedObjects

The associated objects of the tag.

Returns:

AssociatedObjects: The associated objects of the tag.

audit_info() AuditDTO

Retrieve the audit information of the entity.

Returns:

AuditDTO: The audit information of the entity.

comment() str

Get the comment of the tag.

Returns:

str: The comment of the tag.

count() int

Retrieve the number of objects that are associated with this Tag

Returns:

int: The number of objects that are associated with this Tag

get_response(url: str, error_handler: ErrorHandler) Response

Get the response from the server, for testing convenience.

Args:

url (str): The url to get the response from. error_handler (ErrorHandlers): The error handler to use.

Returns:

Response: The response from the server.

inherited() bool | None

Check if the tag is inherited from a parent object or not.

If the tag is inherited, it will return True, if it is owned by the object itself, it will return False.

Note. The return value is optional, only when the tag is associated with an object, and called from the object, the return value will be present. Otherwise, it will be empty.

Returns:
Optional[bool]:

True if the tag is inherited, false if it is owned by the object itself. Empty if the tag is not associated with any object.

name() str

Get the name of the tag.

Returns:

str: The name of the tag.

objects() list[gravitino.api.metadata_object.MetadataObject]

Retrieve the list of objects that are associated with this tag.

Returns:

list[MetadataObject]: The list of objects that are associated with this tag.

properties() dict[str, str]

Get the properties of the tag.

Returns:

Dict[str, str]: The properties of the tag.