Skip to content

Commit f703002

Browse files
committed
improve jobinputs model
1 parent 98b53e5 commit f703002

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

clients/python/src/osparc/_api_solvers_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def create_job(
103103
self, solver_key: str, version: str, job_inputs: JobInputs, **kwargs
104104
):
105105
_job_inputs = _JobInputs.from_json(job_inputs.model_dump_json())
106+
assert _job_inputs is not None
106107
kwargs = {**kwargs, **ParentProjectInfo().model_dump(exclude_none=True)}
107108
return super().create_job(solver_key, version, _job_inputs, **kwargs)
108109

clients/python/src/osparc/_api_studies_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import httpx
1010
from .models import JobInputs, JobLogsMap, PageStudy
1111
from osparc_client.api.studies_api import StudiesApi as _StudiesApi
12+
from osparc_client import JobInputs as _JobInputs
1213
from tqdm.asyncio import tqdm_asyncio
1314

1415
from ._api_client import ApiClient
@@ -64,8 +65,10 @@ def __getattr__(self, name: str) -> Any:
6465
return super().__getattribute__(name)
6566

6667
def create_study_job(self, study_id: str, job_inputs: JobInputs, **kwargs):
68+
_job_inputs = _JobInputs.from_json(job_inputs.model_dump_json())
69+
assert _job_inputs is not None
6770
kwargs = {**kwargs, **ParentProjectInfo().model_dump(exclude_none=True)}
68-
return super().create_study_job(study_id, job_inputs, **kwargs)
71+
return super().create_study_job(study_id, _job_inputs, **kwargs)
6972

7073
def clone_study(self, study_id: str, **kwargs):
7174
kwargs = {**kwargs, **ParentProjectInfo().model_dump(exclude_none=True)}

clients/python/src/osparc/_models.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88

99
class JobInputs(BaseModel):
10-
values: Dict[str, Union[File, List[object], bool, float, int, str, None]] = Field(
11-
kw_only=False
12-
)
10+
values: Dict[str, Union[File, List[object], bool, float, int, str, None]]
1311

1412
def __init__(
1513
self, values: Dict[str, Union[File, List[object], bool, float, int, str, None]]

0 commit comments

Comments
 (0)