Skip to content

Commit 605fd28

Browse files
committed
Fix latest functions PR comments
1 parent e032e1e commit 605fd28

File tree

4 files changed

+71
-94
lines changed

4 files changed

+71
-94
lines changed

packages/service-library/src/servicelib/rabbitmq/rpc_interfaces/webserver/functions/functions_rpc_interface.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,9 @@ async def list_function_job_collections(
151151
pagination_offset=pagination_offset,
152152
pagination_limit=pagination_limit,
153153
)
154-
assert isinstance(result, tuple)
155-
return (
156-
TypeAdapter(list[RegisteredFunctionJobCollection]).validate_python(
157-
result[0]
158-
), # Validates the result as a list of RegisteredFunctionJobCollections
159-
TypeAdapter(PageMetaInfoLimitOffset).validate_python(result[1]), # nosec
160-
)
154+
return TypeAdapter(
155+
tuple[list[RegisteredFunctionJobCollection], PageMetaInfoLimitOffset]
156+
).validate_python(result)
161157

162158

163159
@log_decorator(_logger, level=logging.DEBUG)

services/api-server/openapi.json

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5358,9 +5358,9 @@
53585358
"discriminator": {
53595359
"propertyName": "function_class",
53605360
"mapping": {
5361-
"project": "#/components/schemas/ProjectFunctionJob",
5362-
"python_code": "#/components/schemas/PythonCodeFunctionJob",
5363-
"solver": "#/components/schemas/SolverFunctionJob"
5361+
"PROJECT": "#/components/schemas/ProjectFunctionJob",
5362+
"PYTHON_CODE": "#/components/schemas/PythonCodeFunctionJob",
5363+
"SOLVER": "#/components/schemas/SolverFunctionJob"
53645364
}
53655365
},
53665366
"title": "Function Job"
@@ -5388,9 +5388,9 @@
53885388
"discriminator": {
53895389
"propertyName": "function_class",
53905390
"mapping": {
5391-
"project": "#/components/schemas/RegisteredProjectFunctionJob",
5392-
"python_code": "#/components/schemas/RegisteredPythonCodeFunctionJob",
5393-
"solver": "#/components/schemas/RegisteredSolverFunctionJob"
5391+
"PROJECT": "#/components/schemas/RegisteredProjectFunctionJob",
5392+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunctionJob",
5393+
"SOLVER": "#/components/schemas/RegisteredSolverFunctionJob"
53945394
}
53955395
},
53965396
"title": "Response Register Function Job V0 Function Jobs Post"
@@ -5451,9 +5451,9 @@
54515451
"discriminator": {
54525452
"propertyName": "function_class",
54535453
"mapping": {
5454-
"project": "#/components/schemas/RegisteredProjectFunctionJob",
5455-
"python_code": "#/components/schemas/RegisteredPythonCodeFunctionJob",
5456-
"solver": "#/components/schemas/RegisteredSolverFunctionJob"
5454+
"PROJECT": "#/components/schemas/RegisteredProjectFunctionJob",
5455+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunctionJob",
5456+
"SOLVER": "#/components/schemas/RegisteredSolverFunctionJob"
54575457
}
54585458
},
54595459
"title": "Response Get Function Job V0 Function Jobs Function Job Id Get"
@@ -5903,9 +5903,9 @@
59035903
"discriminator": {
59045904
"propertyName": "function_class",
59055905
"mapping": {
5906-
"project": "#/components/schemas/RegisteredProjectFunctionJob",
5907-
"python_code": "#/components/schemas/RegisteredPythonCodeFunctionJob",
5908-
"solver": "#/components/schemas/RegisteredSolverFunctionJob"
5906+
"PROJECT": "#/components/schemas/RegisteredProjectFunctionJob",
5907+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunctionJob",
5908+
"SOLVER": "#/components/schemas/RegisteredSolverFunctionJob"
59095909
}
59105910
}
59115911
},
@@ -6765,9 +6765,9 @@
67656765
"discriminator": {
67666766
"propertyName": "function_class",
67676767
"mapping": {
6768-
"project": "#/components/schemas/ProjectFunction",
6769-
"python_code": "#/components/schemas/PythonCodeFunction",
6770-
"solver": "#/components/schemas/SolverFunction"
6768+
"PROJECT": "#/components/schemas/ProjectFunction",
6769+
"PYTHON_CODE": "#/components/schemas/PythonCodeFunction",
6770+
"SOLVER": "#/components/schemas/SolverFunction"
67716771
}
67726772
},
67736773
"title": "Function"
@@ -6795,9 +6795,9 @@
67956795
"discriminator": {
67966796
"propertyName": "function_class",
67976797
"mapping": {
6798-
"project": "#/components/schemas/RegisteredProjectFunction",
6799-
"python_code": "#/components/schemas/RegisteredPythonCodeFunction",
6800-
"solver": "#/components/schemas/RegisteredSolverFunction"
6798+
"PROJECT": "#/components/schemas/RegisteredProjectFunction",
6799+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunction",
6800+
"SOLVER": "#/components/schemas/RegisteredSolverFunction"
68016801
}
68026802
},
68036803
"title": "Response Register Function V0 Functions Post"
@@ -6923,9 +6923,9 @@
69236923
"discriminator": {
69246924
"propertyName": "function_class",
69256925
"mapping": {
6926-
"project": "#/components/schemas/RegisteredProjectFunction",
6927-
"python_code": "#/components/schemas/RegisteredPythonCodeFunction",
6928-
"solver": "#/components/schemas/RegisteredSolverFunction"
6926+
"PROJECT": "#/components/schemas/RegisteredProjectFunction",
6927+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunction",
6928+
"SOLVER": "#/components/schemas/RegisteredSolverFunction"
69296929
}
69306930
},
69316931
"title": "Response Get Function V0 Functions Function Id Get"
@@ -7055,9 +7055,9 @@
70557055
"discriminator": {
70567056
"propertyName": "function_class",
70577057
"mapping": {
7058-
"project": "#/components/schemas/RegisteredProjectFunction",
7059-
"python_code": "#/components/schemas/RegisteredPythonCodeFunction",
7060-
"solver": "#/components/schemas/RegisteredSolverFunction"
7058+
"PROJECT": "#/components/schemas/RegisteredProjectFunction",
7059+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunction",
7060+
"SOLVER": "#/components/schemas/RegisteredSolverFunction"
70617061
}
70627062
},
70637063
"title": "Response Update Function Title V0 Functions Function Id Title Patch"
@@ -7137,9 +7137,9 @@
71377137
"discriminator": {
71387138
"propertyName": "function_class",
71397139
"mapping": {
7140-
"project": "#/components/schemas/RegisteredProjectFunction",
7141-
"python_code": "#/components/schemas/RegisteredPythonCodeFunction",
7142-
"solver": "#/components/schemas/RegisteredSolverFunction"
7140+
"PROJECT": "#/components/schemas/RegisteredProjectFunction",
7141+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunction",
7142+
"SOLVER": "#/components/schemas/RegisteredSolverFunction"
71437143
}
71447144
},
71457145
"title": "Response Update Function Description V0 Functions Function Id Description Patch"
@@ -7442,9 +7442,9 @@
74427442
"discriminator": {
74437443
"propertyName": "function_class",
74447444
"mapping": {
7445-
"project": "#/components/schemas/RegisteredProjectFunctionJob",
7446-
"python_code": "#/components/schemas/RegisteredPythonCodeFunctionJob",
7447-
"solver": "#/components/schemas/RegisteredSolverFunctionJob"
7445+
"PROJECT": "#/components/schemas/RegisteredProjectFunctionJob",
7446+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunctionJob",
7447+
"SOLVER": "#/components/schemas/RegisteredSolverFunctionJob"
74487448
}
74497449
},
74507450
"title": "Response Run Function V0 Functions Function Id Run Post"
@@ -8952,9 +8952,9 @@
89528952
"discriminator": {
89538953
"propertyName": "function_class",
89548954
"mapping": {
8955-
"project": "#/components/schemas/RegisteredProjectFunctionJob",
8956-
"python_code": "#/components/schemas/RegisteredPythonCodeFunctionJob",
8957-
"solver": "#/components/schemas/RegisteredSolverFunctionJob"
8955+
"PROJECT": "#/components/schemas/RegisteredProjectFunctionJob",
8956+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunctionJob",
8957+
"SOLVER": "#/components/schemas/RegisteredSolverFunctionJob"
89588958
}
89598959
}
89608960
},
@@ -9029,9 +9029,9 @@
90299029
"discriminator": {
90309030
"propertyName": "function_class",
90319031
"mapping": {
9032-
"project": "#/components/schemas/RegisteredProjectFunction",
9033-
"python_code": "#/components/schemas/RegisteredPythonCodeFunction",
9034-
"solver": "#/components/schemas/RegisteredSolverFunction"
9032+
"PROJECT": "#/components/schemas/RegisteredProjectFunction",
9033+
"PYTHON_CODE": "#/components/schemas/RegisteredPythonCodeFunction",
9034+
"SOLVER": "#/components/schemas/RegisteredSolverFunction"
90359035
}
90369036
}
90379037
},
@@ -9632,9 +9632,9 @@
96329632
"properties": {
96339633
"function_class": {
96349634
"type": "string",
9635-
"const": "project",
9635+
"const": "PROJECT",
96369636
"title": "Function Class",
9637-
"default": "project"
9637+
"default": "PROJECT"
96389638
},
96399639
"title": {
96409640
"type": "string",
@@ -9741,9 +9741,9 @@
97419741
},
97429742
"function_class": {
97439743
"type": "string",
9744-
"const": "project",
9744+
"const": "PROJECT",
97459745
"title": "Function Class",
9746-
"default": "project"
9746+
"default": "PROJECT"
97479747
},
97489748
"project_job_id": {
97499749
"type": "string",
@@ -9764,9 +9764,9 @@
97649764
"properties": {
97659765
"function_class": {
97669766
"type": "string",
9767-
"const": "python_code",
9767+
"const": "PYTHON_CODE",
97689768
"title": "Function Class",
9769-
"default": "python_code"
9769+
"default": "PYTHON_CODE"
97709770
},
97719771
"title": {
97729772
"type": "string",
@@ -9872,9 +9872,9 @@
98729872
},
98739873
"function_class": {
98749874
"type": "string",
9875-
"const": "python_code",
9875+
"const": "PYTHON_CODE",
98769876
"title": "Function Class",
9877-
"default": "python_code"
9877+
"default": "PYTHON_CODE"
98789878
}
98799879
},
98809880
"type": "object",
@@ -9922,9 +9922,9 @@
99229922
"properties": {
99239923
"function_class": {
99249924
"type": "string",
9925-
"const": "project",
9925+
"const": "PROJECT",
99269926
"title": "Function Class",
9927-
"default": "project"
9927+
"default": "PROJECT"
99289928
},
99299929
"title": {
99309930
"type": "string",
@@ -10037,9 +10037,9 @@
1003710037
},
1003810038
"function_class": {
1003910039
"type": "string",
10040-
"const": "project",
10040+
"const": "PROJECT",
1004110041
"title": "Function Class",
10042-
"default": "project"
10042+
"default": "PROJECT"
1004310043
},
1004410044
"uid": {
1004510045
"type": "string",
@@ -10066,9 +10066,9 @@
1006610066
"properties": {
1006710067
"function_class": {
1006810068
"type": "string",
10069-
"const": "python_code",
10069+
"const": "PYTHON_CODE",
1007010070
"title": "Function Class",
10071-
"default": "python_code"
10071+
"default": "PYTHON_CODE"
1007210072
},
1007310073
"title": {
1007410074
"type": "string",
@@ -10180,9 +10180,9 @@
1018010180
},
1018110181
"function_class": {
1018210182
"type": "string",
10183-
"const": "python_code",
10183+
"const": "PYTHON_CODE",
1018410184
"title": "Function Class",
10185-
"default": "python_code"
10185+
"default": "PYTHON_CODE"
1018610186
},
1018710187
"uid": {
1018810188
"type": "string",
@@ -10203,9 +10203,9 @@
1020310203
"properties": {
1020410204
"function_class": {
1020510205
"type": "string",
10206-
"const": "solver",
10206+
"const": "SOLVER",
1020710207
"title": "Function Class",
10208-
"default": "solver"
10208+
"default": "SOLVER"
1020910209
},
1021010210
"title": {
1021110211
"type": "string",
@@ -10324,9 +10324,9 @@
1032410324
},
1032510325
"function_class": {
1032610326
"type": "string",
10327-
"const": "solver",
10327+
"const": "SOLVER",
1032810328
"title": "Function Class",
10329-
"default": "solver"
10329+
"default": "SOLVER"
1033010330
},
1033110331
"uid": {
1033210332
"type": "string",
@@ -10490,9 +10490,9 @@
1049010490
"properties": {
1049110491
"function_class": {
1049210492
"type": "string",
10493-
"const": "solver",
10493+
"const": "SOLVER",
1049410494
"title": "Function Class",
10495-
"default": "solver"
10495+
"default": "SOLVER"
1049610496
},
1049710497
"title": {
1049810498
"type": "string",
@@ -10605,9 +10605,9 @@
1060510605
},
1060610606
"function_class": {
1060710607
"type": "string",
10608-
"const": "solver",
10608+
"const": "SOLVER",
1060910609
"title": "Function Class",
10610-
"default": "solver"
10610+
"default": "SOLVER"
1061110611
},
1061210612
"solver_job_id": {
1061310613
"type": "string",

services/api-server/src/simcore_service_api_server/models/schemas/functions_api_schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from enum import Enum
22
from typing import Annotated, Any, Literal, TypeAlias
33

4-
from models_library import projects
4+
from models_library.projects import ProjectID
55
from pydantic import BaseModel, Field
66

7-
FunctionID: TypeAlias = projects.ProjectID
7+
FunctionID: TypeAlias = ProjectID
88

99

1010
class FunctionSchema(BaseModel):
@@ -53,8 +53,8 @@ class PythonCodeFunction(Function):
5353
Field(discriminator="function_type"),
5454
]
5555

56-
FunctionJobID: TypeAlias = projects.ProjectID
57-
FunctionJobCollectionID: TypeAlias = projects.ProjectID
56+
FunctionJobID: TypeAlias = ProjectID
57+
FunctionJobCollectionID: TypeAlias = ProjectID
5858

5959

6060
class FunctionJob(BaseModel):

0 commit comments

Comments
 (0)