DatasetVersion

class verta.dataset.entities.DatasetVersion(conn, conf, msg)

Object representing a ModelDB dataset version.

Changed in version 0.16.0: The dataset versioning interface was updated for flexibility, robustness, and consistency with other ModelDB entities.

This class provides read/write functionality for dataset version metadata and access to its content.

There should not be a need to instantiate this class directly; please use Dataset.create_version().

Variables:
  • id (str) – ID of this dataset version.

  • version (int) – Version number of this dataset version.

  • dataset_id (str) – ID of this version’s dataset.

  • parent_id (str) – ID of this version’s preceding version.

add_attribute(key, value)

Adds an attribute to this dataset version.

Parameters:
  • key (str) – Name of the attribute.

  • value (one of {None, bool, float, int, str, list, dict}) – Value of the attribute.

add_attributes(attrs)

Adds potentially multiple attributes to this dataset version.

Parameters:

attributes (dict of str to {None, bool, float, int, str, list, dict}) – Attributes.

add_tag(tag)

Adds a tag to this dataset version.

Parameters:

tag (str) – Tag to add.

add_tags(tags)

Adds multiple tags to this dataset version.

Parameters:

tags (list of str) – Tags to add.

del_attribute(key)

Deletes the attribute with name key from this dataset version.

This method will not raise an error if the attribute does not exist.

Parameters:

key (str) – Name of the attribute.

del_tag(tag)

Deletes a tag from this dataset version.

This method will not raise an error if the tag does not exist.

Parameters:

tag (str) – Tag to delete.

delete()

Deletes this dataset version.

get_attribute(key)

Gets the attribute with name key from this dataset version.

Parameters:

key (str) – Name of the attribute.

Returns:

one of {None, bool, float, int, str} – Value of the attribute.

get_attributes()

Gets all attributes from this dataset version.

Returns:

dict of str to {None, bool, float, int, str} – Names and values of all attributes.

get_content()

Returns the content of this dataset version.

Returns:

dataset (dataset) – Dataset content.

get_description()

Gets the description of this dataset version.

Returns:

str – Description of this dataset version.

get_tags()

Gets all tags from this dataset version.

Returns:

list of str – All tags.

list_components()

Shorthand for get_content().list_components().

set_description(desc)

Sets the description of this dataset version.

Parameters:

desc (str) – Description to set.