arthurai.client.validation.validate_multistatus_response_and_get_failures#

arthurai.client.validation.validate_multistatus_response_and_get_failures(response, raise_on_failures=False)#

Validate a 207 MultiStatus response and return the failures it contains.

Parameters
  • response (Response) –

    requests.Response object to validate, with the following body format:

    {
        "counts": {
            "success": 0,
            "failure": 0,
            "total": 0
        },
        "results": [
            {
                "message": "success",
                "status": 200
            }
        ]
    }
    

  • raise_on_failures (bool) – if True, raise an exception if the response contains any failures

Return type

Tuple[List[dict], List[dict]]

Returns

a tuple of two lists: user-caused failures and internal failures

Raises
  • ArthurInternalValueError – If the response does not have 207 status code, or is incorrectly formatted, or ‘counts’ and ‘results’ do not agree

  • ResponseClientError – if raise_on_failures and the response contains only client errors

  • ResponseServerError – if raise_on_failures and the response contains server errors