|
36 | 36 |
|
37 | 37 | # ArgumentTypes are types used in the job inputs (see ResultsTypes) |
38 | 38 | ArgumentTypes: TypeAlias = ( |
39 | | - File | StrictFloat | StrictInt | StrictBool | str | list |
40 | | -) # TODO: should be nullable |
| 39 | + File | StrictFloat | StrictInt | StrictBool | str | list | None |
| 40 | +) |
41 | 41 | KeywordArguments: TypeAlias = dict[str, ArgumentTypes] |
42 | 42 | PositionalArguments: TypeAlias = list[ArgumentTypes] |
43 | 43 |
|
@@ -152,9 +152,7 @@ class JobMetadata(BaseModel): |
152 | 152 | metadata: dict[str, MetaValueType] = Field(..., description="Custom key-value map") |
153 | 153 |
|
154 | 154 | # 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)") |
158 | 156 |
|
159 | 157 | model_config = ConfigDict( |
160 | 158 | json_schema_extra={ |
@@ -200,15 +198,13 @@ class Job(BaseModel): |
200 | 198 | ) |
201 | 199 |
|
202 | 200 | # 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( |
207 | 203 | ..., 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( |
210 | 206 | ..., description="Link to the job outputs (sub-collection)" |
211 | | - ) # TODO: should be nullable |
| 207 | + ) |
212 | 208 |
|
213 | 209 | model_config = ConfigDict( |
214 | 210 | json_schema_extra={ |
@@ -295,14 +291,14 @@ class JobStatus(BaseModel): |
295 | 291 | submitted_at: datetime.datetime = Field( |
296 | 292 | ..., description="Last modification timestamp of the solver job" |
297 | 293 | ) |
298 | | - started_at: datetime.datetime = Field( |
| 294 | + started_at: datetime.datetime | None = Field( |
299 | 295 | None, |
300 | 296 | 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( |
303 | 299 | None, |
304 | 300 | description="Timestamp at which the solver finished or killed execution or None if the event did not occur", |
305 | | - ) # TODO: should be nullable |
| 301 | + ) |
306 | 302 |
|
307 | 303 | model_config = ConfigDict( |
308 | 304 | json_schema_extra={ |
@@ -334,7 +330,7 @@ def create_from_headers(cls, headers: Headers) -> "JobPricingSpecification | Non |
334 | 330 |
|
335 | 331 | class JobLog(BaseModel): |
336 | 332 | job_id: ProjectID |
337 | | - node_id: NodeID = None # TODO: should be nullable |
| 333 | + node_id: NodeID | None = None |
338 | 334 | log_level: LogLevelInt |
339 | 335 | messages: list[LogMessageStr] |
340 | 336 |
|
|
0 commit comments