Tags ​
Tags are used to categorize content. You can attach tags to runs, models and datasets. Tags are per-project, so you can have a tag with the same name in different projects, but only one tag with the same name in the same project.
Create a tag ​
You can create a tag using the create
method. You can only create a tag if it does not exist in the project. If the tag already exists, the method will finish without errors.
import pyhectiqlab.functional as hl
hl.create_tag(name="my-tag", project="hectiq-ai/demo")
from pyhectiqlab import Tag
tag = Tag.create(name="my-tag")
hectiq-lab Tag.create --name "my-tag" --project "hectiq-ai/demo"
Name | Type | Default | Description |
---|---|---|---|
name | str | The name of the tag. | |
project | str, optional | The project where the tag will be created. | |
color | str, optional | The color of the tag. If the color is unset, a random color is assigned. |
List tags ​
You can list tags using the list
method. This method is only available from the functional and tag
object-oriented approach.
import pyhectiqlab.functional as hl
hl.list_tags(project="hectiq-ai/demo")
from pyhectiqlab import Tag
tag = Tag.list(project="hectiq-ai/demo")
hectiq-lab Tag.list --project "hectiq-ai/demo"
Name | Type | Default | Description |
---|---|---|---|
project | str | None | Project name. |
page | int | 1 | Page number. |
limit | int | 100 | Number of tags per page. |
order_by | str | None | Order by field. |
order_direction | str | None | Order direction. |
Attach tags to a run ​
At initialization of a run, you can specify the tags that you want to attach to the run. You can also attach tags to an existing run using the add_tag
method. If the tag does not exist, it will be created.
import pyhectiqlab.functional as hl
hl.add_tags_to_run(tag="my-tag")
from pyhectiqlab import Tag
Tag.attach_to_run(tags=["my-tag"])
Run.add_tags(tags=["my-tag"])
hectiq-lab Tag.attach_to_run --run_id "9c29ckw0" --tags "my-tag" --tags "my-other-tag" --project "hectiq-ai/demo"
Name | Type | Default | Description |
---|---|---|---|
tags | List[str] | - | List of tags to attach. |
run_id | str | - | Run ID. |
project | str | None | Project name. Optional, with no default provided means it should be considered None . |
wait_response | bool | False | Set to true to attach sync. If False, the attachment is made in background. |
Detach tag from a run ​
While you can attach many tags to a run, you can only detach one tag at a time. You can detach a tag from a run using the detach
method. If the tag doesn't exist or is not attached to the run, the method will finish without errors.
import pyhectiqlab.functional as hl
hl.detach_tag(run_id="9c29ckw0", tag="my-tag")
from pyhectiqlab import Tag
Tag.detach_from_run(run_id="9c29ckw0", tag="my-tag")
hectiq-lab Tag.detach_from_run --run_id "9c29ckw0" --tag "my-tag" --project "hectiq-ai/demo"
Name | Type | Default | Description |
---|---|---|---|
run_id | str | - | Run ID. |
tag | str | - | Tag name. |
project | str, optional | None | Project name. |
wait_response | bool | False | Set to true to detach sync. If False , the detachment is made in background. |