Key-Values
- class datarobot.models.key_values.KeyValue
Bases:
APIObject
A DataRobot Key-Value.
Added in version v3.4.
- Variables:
id (
str
) – ID of the Key-Valuecreated_at (
str
) – creation time of the Key-Valueentity_id (
str
) – ID of the related Entityentity_type (
KeyValueEntityType
) – type of the related Entityname (
str
) – Key-Value namevalue (
str
) – Key-Value valuenumeric_value (
float
) – Key-Value numeric valueboolean_value (
bool
) – Key-Value boolean valuevalue_type (
KeyValueType
) – Key-Value typedescription (
str
) – Key-Value descriptioncreator_id (
str
) – ID of the user who created the Key-Valuecreator_name (
str
) – ID of the user who created the Key-Valuecategory (
KeyValueCategory
) – Key-Value categoryartifact_size (
int
) – size in bytes of associated image, if applicableoriginal_file_name (
str
) – name of uploaded original image or dataset fileis_editable (
bool
) – true if a user with permissions can edit or deleteis_dataset_missing (
bool
) – true if the key-value type is “dataset” and its dataset is not visible to the usererror_message (
str
) – additional information if “isDataSetMissing” is true. Blank if there are no errors
- classmethod get(key_value_id)
Get Key-Value by id.
Added in version v3.4.
- Parameters:
key_value_id (
str
) – ID of the Key-Value- Returns:
retrieved Key-Value
- Return type:
- Raises:
datarobot.errors.ClientError – if the server responded with 4xx status.
datarobot.errors.ServerError – if the server responded with 5xx status.
- classmethod list(entity_id, entity_type)
List Key-Values.
Added in version v3.4.
- Parameters:
entity_id (
str
) – ID of the related Entityentity_type (
KeyValueEntityType
) – type of the related Entity
- Returns:
a list of Key-Values
- Return type:
List[KeyValue]
- Raises:
datarobot.errors.ClientError – if the server responded with 4xx status
datarobot.errors.ServerError – if the server responded with 5xx status
- classmethod find(entity_id, entity_type, name)
Find Key-Value by name.
Added in version v3.4.
- Parameters:
entity_id (
str
) – ID of the related Entityentity_type (
KeyValueEntityType
) – type of the related Entityname (
str
) – name of the Key-Value
- Returns:
a list of Key-Values
- Return type:
List[KeyValue]
- Raises:
datarobot.errors.ClientError – if the server responded with 4xx status
datarobot.errors.ServerError – if the server responded with 5xx status
- classmethod create(entity_id, entity_type, name, category, value_type, value=None, description=None)
Create a Key-Value.
Added in version v3.4.
- Parameters:
entity_id (
str
) – ID of the associated resourceentity_type (
KeyValueEntityType
) – type of the associated resourcename (
str
) – name of the Key-Value. Cannot contain: { } ; |category (
KeyValueCategory
) – category of the Key-Valuevalue_type (
KeyValueType
) – type of the Key-Value valuevalue (
Optional[Union[str
,float
,bool]]
) – value of Key-Valuedescription (
Optional[str]
) – description of the Key-Value
- Returns:
created Key-Value
- Return type:
- Raises:
datarobot.errors.ClientError – if the server responded with 4xx status.
datarobot.errors.ServerError – if the server responded with 5xx status.
- update(entity_id=None, entity_type=None, name=None, category=None, value_type=None, value=None, description=None, comment=None)
Update Key-Value.
Added in version v3.4.
- Parameters:
entity_id (
Optional[str]
) – ID of the associated resourceentity_type (
Optional[KeyValueEntityType]
) – type of the associated resourcename (
Optional[str]
) – name of the Key-Value. Cannot contain: { } ; |category (
Optional[KeyValueCategory]
) – category of the Key-Valuevalue_type (
Optional[KeyValueType]
) – type of the Key-Value valuevalue (
Optional[[Union[str
,float
,bool]]
) – value of Key-Valuedescription (
Optional[str]
) – description of the Key-Valuecomment (
Optional[str]
) – user comment explaining the change
- Raises:
datarobot.errors.ClientError – if the server responded with 4xx status.
datarobot.errors.ServerError – if the server responded with 5xx status.
- Return type:
None
- refresh()
Update Key-Value with the latest data from server. :rtype:
None
Added in version v3.4.
- Raises:
datarobot.errors.ClientError – if the server responded with 4xx status
datarobot.errors.ServerError – if the server responded with 5xx status
- delete()
Delete Key-Value. :rtype:
None
Added in version v3.4.
- Raises:
datarobot.errors.ClientError – If the server responded with 4xx status.
datarobot.errors.ServerError – If the server responded with 5xx status.
- get_value()
Get a value of Key-Value.
Added in version v3.4.
- Returns:
value depending on the value type
- Return type:
Union[str
,float
,boolean]
- class datarobot.enums.KeyValueCategory
Bases:
Enum
Key-Value category
- TRAINING_PARAMETER = 'trainingParameter'
- METRIC = 'metric'
- TAG = 'tag'
- ARTIFACT = 'artifact'
- RUNTIME_PARAMETER = 'runtimeParameter'
- class datarobot.enums.KeyValueEntityType
Bases:
Enum
Key-Value entity type
- DEPLOYMENT = 'deployment'
- MODEL_PACKAGE = 'modelPackage'
- REGISTERED_MODEL = 'registeredModel'
- CUSTOM_JOB = 'customJob'
- CUSTOM_JOB_RUN = 'customJobRun'
- class datarobot.enums.KeyValueType
Bases:
Enum
Key-Value type
- BINARY = 'binary'
- BOOLEAN = 'boolean'
- CREDENTIAL = 'credential'
- DEPLOYMENT_ID = 'deploymentId'
- DATASET = 'dataset'
- IMAGE = 'image'
- JSON = 'json'
- MODEL_VERSION = 'modelVersion'
- NUMERIC = 'numeric'
- PICKLE = 'pickle'
- STRING = 'string'
- URL = 'url'
- YAML = 'yaml'