Skip to content

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.

python
import pyhectiqlab.functional as hl
hl.create_tag(name="my-tag", project="hectiq-ai/demo")
python
from pyhectiqlab import Tag
tag = Tag.create(name="my-tag")
bash
hectiq-lab Tag.create --name "my-tag" --project "hectiq-ai/demo"
NameTypeDefaultDescription
namestrThe name of the tag.
projectstr, optionalThe project where the tag will be created.
colorstr, optionalThe 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.

python
import pyhectiqlab.functional as hl
hl.list_tags(project="hectiq-ai/demo")
python
from pyhectiqlab import Tag
tag = Tag.list(project="hectiq-ai/demo")
bash
hectiq-lab Tag.list --project "hectiq-ai/demo"
NameTypeDefaultDescription
projectstrNoneProject name.
pageint1Page number.
limitint100Number of tags per page.
order_bystrNoneOrder by field.
order_directionstrNoneOrder 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.

python
import pyhectiqlab.functional as hl
hl.add_tags_to_run(tag="my-tag")
python
from pyhectiqlab import Tag
Tag.attach_to_run(tags=["my-tag"])
Run.add_tags(tags=["my-tag"])
bash
hectiq-lab Tag.attach_to_run --run_id "9c29ckw0" --tags "my-tag" --tags "my-other-tag" --project "hectiq-ai/demo"
NameTypeDefaultDescription
tagsList[str]-List of tags to attach.
run_idstr-Run ID.
projectstrNoneProject name. Optional, with no default provided means it should be considered None.
wait_responseboolFalseSet 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.

python
import pyhectiqlab.functional as hl
hl.detach_tag(run_id="9c29ckw0", tag="my-tag")
python
from pyhectiqlab import Tag
Tag.detach_from_run(run_id="9c29ckw0", tag="my-tag")
bash
hectiq-lab Tag.detach_from_run --run_id "9c29ckw0" --tag "my-tag" --project "hectiq-ai/demo"
NameTypeDefaultDescription
run_idstr-Run ID.
tagstr-Tag name.
projectstr, optionalNoneProject name.
wait_responseboolFalseSet to true to detach sync. If False, the detachment is made in background.