Skip to content

Commit 99a4a65

Browse files
committed
fix create job function
1 parent 3fd8207 commit 99a4a65

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

clients/python/requirements/unit-test.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
-r ../../../requirements.txt
22
black
33
faker
4+
openapi-spec-validator #installed as backend for prance
45
pipdeptree
56
pipreqs
7+
prance
68
pytest
79
pytest-asyncio
810
pytest-mock

clients/python/src/osparc/_api_solvers_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
JobInputs,
99
OnePageSolverPort,
1010
SolverPort,
11+
Job,
1112
JobOutputs,
1213
JobMetadata,
1314
JobMetadataUpdate,
@@ -111,11 +112,12 @@ def jobs(self, solver_key: str, version: str, **kwargs) -> PaginationGenerator:
111112
@validate_call
112113
def create_job(
113114
self, solver_key: str, version: str, job_inputs: JobInputs, **kwargs
114-
):
115+
) -> Job:
115116
_job_inputs = _JobInputs.from_json(job_inputs.model_dump_json())
116117
assert _job_inputs is not None
117118
kwargs = {**kwargs, **ParentProjectInfo().model_dump(exclude_none=True)}
118-
return super().create_job(solver_key, version, _job_inputs, **kwargs)
119+
_job = super().create_job(solver_key, version, _job_inputs, **kwargs)
120+
return Job.model_validate(_job.to_dict())
119121

120122
def get_job_output_logfile(self, *args, **kwargs):
121123
data = super().get_job_output_logfile(*args, **kwargs)

0 commit comments

Comments
 (0)