Skip to content

Commit 4de5fa2

Browse files
committed
incorporated review comments
1 parent 917f3ef commit 4de5fa2

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

sap/aibus/dar/client/model_manager_client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,9 @@ def read_job_by_model_name(self, model_name: str) -> dict:
131131
for job in jobs:
132132
if job["modelName"] == model_name:
133133
return job
134-
else: # pylint: disable=useless-else-on-loop
135-
raise JobNotFound(
136-
"Job with model name '{}' could not be found".format(model_name)
137-
)
134+
raise JobNotFound(
135+
"Job with model name '{}' could not be found".format(model_name)
136+
)
138137

139138
def delete_job_by_id(self, job_id: str) -> None:
140139
"""

system_tests/workflow/test_end_to_end.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,13 @@ def test_create(
143143
# Job
144144
# The Model resource does not have a jobId property, so we
145145
# have to look up the job ID via the job collection
146-
job_collection = model_manager_client.read_job_collection()
147-
job_id = None
148-
for job in job_collection["jobs"]:
149-
if job["modelName"] == model_name:
150-
job_id = job["id"]
151-
break
152-
assert job_id is not None
146+
job = model_manager_client.read_job_by_model_name(model_name)
147+
assert job["id"] is not None
148+
job_id = job["id"]
153149

154150
self._assert_job_exists(model_manager_client, job_id)
155151
# Get dataset ID used in this job
156152
job_resource = model_manager_client.read_job_by_id(job_id)
157-
job_by_name = model_manager_client.read_job_by_model_name(model_name)
158-
assert job_by_name is not None
159153
dataset_id = job_resource["datasetId"]
160154
# Clean up job
161155
model_manager_client.delete_job_by_id(job_id)

0 commit comments

Comments
 (0)