From 35d95d36685641001328e297eac960ea1f8241f9 Mon Sep 17 00:00:00 2001 From: Fatih Kurtoglu Date: Tue, 4 Jun 2024 17:25:39 -0700 Subject: [PATCH 1/2] Handle missing raw and retries on Response --- scaleapi/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scaleapi/api.py b/scaleapi/api.py index 58cbf19..3c7c55f 100644 --- a/scaleapi/api.py +++ b/scaleapi/api.py @@ -144,10 +144,10 @@ def _api_request( # Some endpoints only return 'OK' message without JSON return json elif res.status_code == 409 and "task" in endpoint and body.get("unique_id"): - retry_history = None - if "retries" in res.raw and "history" in res.raw.retries: + try: retry_history = res.raw.retries.history - + except AttributeError: + retry_history = [] # Example RequestHistory tuple # RequestHistory(method='POST', # url='/v1/task/imageannotation', From 77741be6519350c193012cfcff3c15aa06a7728b Mon Sep 17 00:00:00 2001 From: Fatih Kurtoglu Date: Tue, 4 Jun 2024 18:04:10 -0700 Subject: [PATCH 2/2] bump version --- scaleapi/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaleapi/_version.py b/scaleapi/_version.py index f4a4da0..f8a04ab 100644 --- a/scaleapi/_version.py +++ b/scaleapi/_version.py @@ -1,2 +1,2 @@ -__version__ = "2.15.7" +__version__ = "2.15.8" __package_name__ = "scaleapi"