Skip to content

utils API reference#

The utils module contains utility functions for logging metadata with the Neptune API.


stringify_unsupported()#

Helper function that converts unsupported values in a collection or dictionary to strings.

The output of this function is lazy-evaluated, as the final type depends on the logging method that is called on the stringified object (for example, assign(obj) versus append(obj)).

Parameters

Name Type Default Description
value dictionary or collection None Dictionary or collection which may contain values of an unsupported type.

Example

>>> import neptune.new as neptune
>>> run = neptune.init_run()
>>> complex_dict = {"tuple": ("learning_rate", 0.01), "accuracy": 0.87}  # (1)!
>>> from neptune.new.utils import stringify_unsupported
>>> run["complex_dict"] = stringify_unsupported(complex_dict)
  1. The tuple is not a supported type.

Related

This function is related to the deprecation of implicit casting to string.

For details, see the neptune 1.0 upgrade guide.