graviti.manager.dataset
#
The implementation of the Dataset and DatasetManager.
Module Contents#
Classes#
This class defines the basic concept of the dataset on Graviti. |
|
This class defines the operations on the dataset on Graviti. |
- class graviti.manager.dataset.Dataset(access_key, url, dataset_id, name, *, alias, default_branch, commit_id, created_at, updated_at, owner, is_public, config)[source]#
Bases:
graviti.utility.UserMutableMapping
[str
,graviti.dataframe.DataFrame
],tensorbay.utility.AttrsMixin
,graviti.utility.ReprMixin
This class defines the basic concept of the dataset on Graviti.
- Parameters
access_key (str) – User’s access key.
url (str) – The URL of the graviti website.
dataset_id (str) – Dataset ID.
name (str) – The name of the dataset, unique for a user.
alias (str) – Dataset alias.
default_branch (str) – The default branch of dataset.
commit_id (str) – The commit ID.
created_at (str) – The time when the dataset was created.
updated_at (str) – The time when the dataset was last modified.
owner (str) – The owner of the dataset.
is_public (bool) – Whether the dataset is public.
config (str) – The config of dataset.
- classmethod from_pyobj(cls, contents)[source]#
Create a
Dataset
instance from python dict.- Parameters
contents (Dict[str, Any]) –
A python dict containing all the information of the dataset:
{ "access_key": <str> "url": <str> "id": <str> "name": <str> "alias": <str> "default_branch": <str> "commit_id": <str> "created_at": <str> "updated_at": <str> "owner": <str> "is_public": <bool> "config": <str> }
cls (Type[_T]) –
- Returns
A
Dataset
instance created from the input python dict.- Return type
_T
- property HEAD(self)[source]#
Return the current branch or commit.
- Returns
The current branch or commit.
- Return type
- property branches(self)[source]#
Get class
BranchManager
instance.- Returns
Required
BranchManager
instance.- Return type
- property drafts(self)[source]#
Get class
DraftManager
instance.- Returns
Required
DraftManager
instance.- Return type
- property commits(self)[source]#
Get class
CommitManager
instance.- Returns
Required
CommitManager
instance.- Return type
- property tags(self)[source]#
Get class
TagManager
instance.- Returns
Required
TagManager
instance.- Return type
- checkout(self, revision)[source]#
Checkout to a commit.
- Parameters
revision (str) – The information to locate the specific commit, which can be the commit id, the branch, or the tag.
- Return type
None
- edit(self, *, name=None, alias=None, default_branch=None)[source]#
Update the meta data of the dataset.
- Parameters
name (Optional[str]) – The new name of the dataset.
alias (Optional[str]) – The new alias of the dataset.
default_branch (Optional[str]) – The new default branch of the dataset.
- Return type
None
- class graviti.manager.dataset.DatasetManager(access_key, url, owner)[source]#
This class defines the operations on the dataset on Graviti.
- Parameters
access_key (str) – User’s access key.
url (str) – The URL of the graviti website.
owner (str) –
- get(self, dataset)[source]#
Get a Graviti dataset with given name.
- Parameters
dataset (str) – The name of the dataset, unique for a user.
- Returns
The requested
Dataset
instance.- Raises
ResourceNotExistError – When the required dataset does not exist.
- Return type