From b4070e850a9e27be2ca33ace98c6070db3d4cfc8 Mon Sep 17 00:00:00 2001 From: ananth102 Date: Wed, 3 Apr 2024 15:06:27 -0700 Subject: [PATCH] fix: correct response in metrics manager The SageMaker metrics api's response returns a list of errors(if there were any). This patch fixes the error code parsing. --- src/sagemaker/experiments/_metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sagemaker/experiments/_metrics.py b/src/sagemaker/experiments/_metrics.py index 31dd679cc8..566e06e293 100644 --- a/src/sagemaker/experiments/_metrics.py +++ b/src/sagemaker/experiments/_metrics.py @@ -197,7 +197,7 @@ def _send_metrics(self, metrics): response = self._metrics_client.batch_put_metrics(**request) errors = response["Errors"] if "Errors" in response else None if errors: - message = errors[0]["Message"] + message = errors[0]["Code"] raise Exception(f'{len(errors)} errors with message "{message}"') def _construct_batch_put_metrics_request(self, batch):