Skip to content

Commit 4ce889a

Browse files
committed
revert changes to models jobs.py
1 parent 2fc71c7 commit 4ce889a

File tree

1 file changed

+13
-17
lines changed
  • services/api-server/src/simcore_service_api_server/models/schemas

1 file changed

+13
-17
lines changed

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

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636

3737
# ArgumentTypes are types used in the job inputs (see ResultsTypes)
3838
ArgumentTypes: TypeAlias = (
39-
File | StrictFloat | StrictInt | StrictBool | str | list
40-
) # TODO: should be nullable
39+
File | StrictFloat | StrictInt | StrictBool | str | list | None
40+
)
4141
KeywordArguments: TypeAlias = dict[str, ArgumentTypes]
4242
PositionalArguments: TypeAlias = list[ArgumentTypes]
4343

@@ -152,9 +152,7 @@ class JobMetadata(BaseModel):
152152
metadata: dict[str, MetaValueType] = Field(..., description="Custom key-value map")
153153

154154
# Links
155-
url: HttpUrl = Field(
156-
..., description="Link to get this resource (self)"
157-
) # TODO: should be nullable
155+
url: HttpUrl | None = Field(..., description="Link to get this resource (self)")
158156

159157
model_config = ConfigDict(
160158
json_schema_extra={
@@ -200,15 +198,13 @@ class Job(BaseModel):
200198
)
201199

202200
# Get links to other resources
203-
url: HttpUrl = Field(
204-
..., description="Link to get this resource (self)"
205-
) # TODO: should be nullable
206-
runner_url: HttpUrl = Field(
201+
url: HttpUrl | None = Field(..., description="Link to get this resource (self)")
202+
runner_url: HttpUrl | None = Field(
207203
..., description="Link to the solver's job (parent collection)"
208-
) # TODO: should be nullable
209-
outputs_url: HttpUrl = Field(
204+
)
205+
outputs_url: HttpUrl | None = Field(
210206
..., description="Link to the job outputs (sub-collection)"
211-
) # TODO: should be nullable
207+
)
212208

213209
model_config = ConfigDict(
214210
json_schema_extra={
@@ -295,14 +291,14 @@ class JobStatus(BaseModel):
295291
submitted_at: datetime.datetime = Field(
296292
..., description="Last modification timestamp of the solver job"
297293
)
298-
started_at: datetime.datetime = Field(
294+
started_at: datetime.datetime | None = Field(
299295
None,
300296
description="Timestamp that indicate the moment the solver starts execution or None if the event did not occur",
301-
) # TODO: should be nullable
302-
stopped_at: datetime.datetime = Field(
297+
)
298+
stopped_at: datetime.datetime | None = Field(
303299
None,
304300
description="Timestamp at which the solver finished or killed execution or None if the event did not occur",
305-
) # TODO: should be nullable
301+
)
306302

307303
model_config = ConfigDict(
308304
json_schema_extra={
@@ -334,7 +330,7 @@ def create_from_headers(cls, headers: Headers) -> "JobPricingSpecification | Non
334330

335331
class JobLog(BaseModel):
336332
job_id: ProjectID
337-
node_id: NodeID = None # TODO: should be nullable
333+
node_id: NodeID | None = None
338334
log_level: LogLevelInt
339335
messages: list[LogMessageStr]
340336

0 commit comments

Comments
 (0)