Table Of Contents
Table Of Contents

gluonts.shell.sagemaker.params module

gluonts.shell.sagemaker.params.decode_sagemaker_parameter(value: str) → Union[list, dict, str][source]

All values passed through the SageMaker API are encoded as strings. Thus we pro-actively decode values that seem like arrays or dicts.

Integer values (e.g. “1”) are handled by pydantic models further down the pipeline.

gluonts.shell.sagemaker.params.decode_sagemaker_parameters(encoded_params: dict) → dict[source]

Decode a SageMaker parameters dictionary where all values are strings.

Example:

>>> decode_sagemaker_parameters({
...     "foo": "[1, 2, 3]",
...     "bar": "hello"
... })
{'foo': [1, 2, 3], 'bar': 'hello'}
gluonts.shell.sagemaker.params.encode_sagemaker_parameter(value: Any) → str[source]

All values passed through the SageMaker API must be encoded as strings.

gluonts.shell.sagemaker.params.encode_sagemaker_parameters(decoded_params: dict) → dict[source]

Encode a SageMaker parameters dictionary where all values are strings.

Example:

>>> encode_sagemaker_parameters({
...     "foo": [1, 2, 3],
...     "bar": "hello"
... })
{'foo': '[1, 2, 3]', 'bar': 'hello'}