Data Collections#

For usage information and examples, see Data Collections

class dataikuapi.dss.data_collection.DSSDataCollection(client, id)#

A handle to interact with a Data Collection on the DSS instance.

Do not create this class directly, instead use dataikuapi.DSSClient.get_data_collection() or DSSDataCollectionListItem.to_data_collection()

get_settings()#

Gets the settings of this Data Collection.

Returns:

a handle to read, modify and save the settings

Return type:

DSSDataCollectionSettings

list_objects(as_type='objects')#

List the objects in this Data Collection

Parameters:

as_type (str) – How to return the list. Supported values are “objects” and “dict” (defaults to objects).

Returns:

The list of objects

Return type:

list of DSSDataCollectionItem if as_type is “objects”, list of dict if as_type is “dict”

add_object(obj)#

Add an object to this Data Collection.

Parameters:

obj (DSSDataset, DSSDataCollectionItem or dict) – object to add to the Data Collection.

delete()#

Delete this Data Collection

This call requires Administrator rights on the Data Collection.

class dataikuapi.dss.data_collection.DSSDataCollectionListItem(client, data)#

An item in a list of Data Collections.

Do not instantiate this class, use dataikuapi.DSSClient.list_data_collections()

get_raw()#

Get the raw representation of this DSSDataCollectionListItem

Return type:

dict

property id#
property display_name#
property description#
property color#
property tags#
property item_count#
property last_modified_on#
to_data_collection()#

Gets the DSSDataCollection corresponding to this list item

Returns:

handle of the Data Collection

Return type:

DSSDataCollection

class dataikuapi.dss.data_collection.DSSDataCollectionSettings(data_collection, settings)#

A handle on the settings of a Data Collection

Do not create this class directly, instead use DSSDataCollection.get_settings()

get_raw()#

Get the raw settings of the Data Collection. This returns a reference to the raw settings, not a copy, so changes made to the returned object will be reflected when saving.

Returns:

the Data Collection raw settings

Return type:

dict

property id#

The Data Collection id (read-only)

Return type:

str

property display_name#

Get or set the name of the Data Collection

Return type:

str

property color#

Get or set the background color of the Data Collection (using #RRGGBB syntax)

Return type:

str

property description#

Get or set the description of the Data Collection

Return type:

str

property tags#

Get or set the tags of the Data Collection

Return type:

list of str

property permissions#

Get or set the permissions controlling who is a reader, contributor or admin of the Data Collection.

If the user is not an admin of the data-collection, the permissions property will be redacted as None.

Returns:

a list of the Data Collection permissions

Return type:

list of dict or None

save()#

Save the changes made on the settings

This call requires Administrator rights on the Data Collection.

class dataikuapi.dss.data_collection.DSSDataCollectionPermissionItem#
classmethod admin_group(group)#

Creates a dict representing an admin authorization for a group

classmethod contributor_group(group)#

Creates a dict representing an contributor authorization for a group

classmethod reader_group(group)#

Creates a dict representing an reader authorization for a group

classmethod admin_user(user)#

Creates a dict representing an admin authorization for a user

classmethod contributor_user(user)#

Creates a dict representing an contributor authorization for a user

classmethod reader_user(user)#

Creates a dict representing an reader authorization for a user

class dataikuapi.dss.data_collection.DSSDataCollectionItem(data_collection, data)#

A handle on an object inside a Data Collection

Do not create this class directly, instead use DSSDataCollection.list_objects()

get_raw()#

Get the raw description of the Data Collection item. This returns a reference to the raw data, not a copy.

Returns:

the Data Collection item raw description

Return type:

dict

get_as_dataset()#

Gets a handle on the corresponding dataset.

Attention

The usability of this handle might be limited by the current user’s authorizations, as seeing a dataset in a data-collection doesn’t necessarily imply a lot of rights.

Returns:

a handle on a dataset

Return type:

dataikuapi.dss.dataset.DSSDataset

remove()#

Remove this object from the Data Collection

This call requires Contributor rights on the Data Collection.