Utilities#

These classes are various utilities that are used in various parts of the API.

class dataikuapi.dss.utils.DSSDatasetSelectionBuilder#

Builder for a “dataset selection”. In DSS, a dataset selection is used to select a part of a dataset for processing.

Depending on the location where it is used, a selection can include: * Sampling * Filtering by partitions (for partitioned datasets) * Filtering by an expression * Selection of columns * Ordering

Please see the sampling documentation of DSS for a detailed explanation of the sampling methods.

build()#
Returns:

the built selection dict

Return type:

dict

with_head_sampling(limit)#

Sets the sampling to ‘first records’ mode

Parameters:

limit (int) – Maximum number of rows in the sample

with_all_data_sampling()#

Sets the sampling to ‘no sampling, all data’ mode

with_random_fixed_nb_sampling(nb)#

Sets the sampling to ‘Random sampling, fixed number of records’ mode

Parameters:

nb (int) – Maximum number of rows in the sample

with_selected_partitions(ids)#

Sets partition filtering on the given partition identifiers.

Warning

The dataset to select must be partitioned.

Parameters:

ids (list) – list of selected partitions

class dataikuapi.dss.utils.DSSFilterBuilder#

Builder for a “filter”. In DSS, a filter is used to define a subset of rows for processing.

build()#
Returns:

the built filter

Return type:

dict

with_distinct()#

Sets the filter to deduplicate

with_formula(expression)#

Sets the formula (DSS formula) used to filter rows

Parameters:

expression (str) – the DSS formula

class dataikuapi.dss.utils.DSSInfoMessages(data)#

Contains a list of dataikuapi.dss.utils.DSSInfoMessage.

Important

Do not instantiate this class.

property messages#

The messages as a list of dataikuapi.dss.utils.DSSInfoMessage

property has_messages#

True if there is any message

property has_error#

True if there is any error message

property max_severity#

The max severity of the messages

property has_success#

True if there is any success message

property has_warning#

True if there is any warning message

class dataikuapi.dss.utils.DSSInfoMessage(data)#

A message with a code, a title, a severity and a content.

Important

Do not instantiate this class.

property severity#

The severity of the message

property code#

The code of the message

property details#

The details of the message

property title#

The title of the message

property message#

The full message