arthurai.util.format_timestamps#

arthurai.util.format_timestamps(inferences, tz=None, timestamp_attributes=None)#

Checks list of json inferences to ensure their timestamps have been converted to ISO8601 conventions.

Parameters
  • inferences (List[Dict[str, Any]]) – Input to send_inferences() function.

  • tz (Union[timezone, str, None]) – datetime timezone object or timezone string

  • timestamp_attributes (Optional[List[str]]) – List of attributes of the model of timestamp type

Return type

List[Dict[str, Any]]

Returns

updated list of json inferences with ISO8601 formatted timestamps

Raises
  • TypeError – timestamp is not of type datetime.datetime

  • ValueError – timestamp is not timezone aware and no location data is provided to remedy