Skip to content

Commit

Permalink
API update
Browse files Browse the repository at this point in the history
  • Loading branch information
gmertes committed Jul 17, 2024
1 parent edcd1e1 commit 4756457
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/anemoi/training/diagnostics/mlflow/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.

import json
import os
import time
from datetime import datetime
Expand Down Expand Up @@ -194,13 +193,7 @@ def _request(self, path, payload):
response_json = response.json()

if response_json.get("status", "") != "OK":
# TODO: there's a bug in the API that returns the error response as a string instead of a json object.
# Remove this when the API is fixed.
if isinstance(response_json["response"], str):
error = json.loads(response_json["response"])
else:
error = response_json["response"]
error_description = error.get("error_description", "Error acquiring token.")
error_description = response_json.get("response", "Error acquiring token.")
raise RuntimeError(error_description)

return response_json["response"]
Expand Down

0 comments on commit 4756457

Please sign in to comment.