Skip to content

Commit 9ea705e

Browse files
committed
chore: fix Python 3.5 compat
1 parent 8d20964 commit 9ea705e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

sap/aibus/dar/client/inference_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def predict_call(work_package):
172172
{
173173
"objectId": inference_object.get("objectId", None),
174174
"labels": None,
175-
"_sdk_error": f"{exc.__class__.__name__}: {exc}",
175+
"_sdk_error": "{}: {}".format(exc.__class__.__name__, str(exc)),
176176
}
177177
for inference_object in work_package
178178
]

tests/sap/aibus/dar/client/test_inference_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def test_bulk_inference_error(self, inference_client: InferenceClient):
294294
"labels": None,
295295
# If this test fails, I found it can make pytest/PyCharm hang because it
296296
# takes too much time in difflib.
297-
"_sdk_error": f"{exc.__class__.__name__}: {exc}",
297+
"_sdk_error": "{}: {}".format(exc.__class__.__name__, str(exc)),
298298
}
299299

300300
expected_response = []
@@ -332,7 +332,9 @@ def test_bulk_inference_error_no_object_ids(
332332
"labels": None,
333333
# If this test fails, I found it can make pytest/PyCharm hang because it
334334
# takes too much time in difflib.
335-
"_sdk_error": f"{exception_404.__class__.__name__}: {exception_404}",
335+
"_sdk_error": "{}: {}".format(
336+
exception_404.__class__.__name__, str(exception_404)
337+
),
336338
}
337339
expected_response = []
338340
expected_response.extend(

0 commit comments

Comments
 (0)