Tag#

TensorBay supports tagging specific commits in a dataset’s history as being important. Typically, people use this functionality to mark release revisions (v1.0, v2.0 and so on).

Before operating tags, a dataset client instance with existing commit is needed.

from tensorbay import GAS

# Please visit `https://gas.graviti.com/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.create_dataset("<DATASET_NAME>")
dataset_client.create_draft("draft-1")
# do the modifications in this draft

Create Tag#

TensorBay SDK supports three approaches of creating the tag.

First is to create the tag when committing.

dataset_client.commit("commit-1", tag="Tag-1")

Second is to create the tag straightforwardly, which is based on the current commit.

dataset_client.create_tag("Tag-1")

Third is to create tag on an existing commit.

commit_id = dataset_client.status.commit_id
dataset_client.create_tag("Tag-1", revision=commit_id)

Get Tag#

tag = dataset_client.get_tag("Tag-1")

List Tags#

tags = dataset_client.list_tags()

Delete Tag#

dataset_client.delete_tag("Tag-1")