|
3 | 3 |
|
4 | 4 | import logging
|
5 | 5 | from collections import deque
|
6 |
| -from typing import Callable, Optional, Union |
| 6 | +from typing import Callable |
7 | 7 | from uuid import UUID
|
8 | 8 |
|
9 | 9 | from fastapi import APIRouter, Depends, status
|
@@ -170,7 +170,7 @@ async def start_job(
|
170 | 170 | solver_key: SolverKeyId,
|
171 | 171 | version: VersionStr,
|
172 | 172 | job_id: UUID,
|
173 |
| - cluster_id: Optional[ClusterID] = None, |
| 173 | + cluster_id: ClusterID | None = None, |
174 | 174 | user_id: PositiveInt = Depends(get_current_user_id),
|
175 | 175 | director2_api: DirectorV2Api = Depends(get_api_client(DirectorV2Api)),
|
176 | 176 | product_name: str = Depends(get_product_name),
|
@@ -253,7 +253,7 @@ async def get_job_outputs(
|
253 | 253 | assert len(node_ids) == 1 # nosec
|
254 | 254 |
|
255 | 255 | outputs: dict[
|
256 |
| - str, Union[float, int, bool, BaseFileLink, str, None] |
| 256 | + str, float | int | bool | BaseFileLink | str | None |
257 | 257 | ] = await get_solver_output_results(
|
258 | 258 | user_id=user_id,
|
259 | 259 | project_uuid=job_id,
|
@@ -322,7 +322,9 @@ async def get_job_output_logfile(
|
322 | 322 | )
|
323 | 323 |
|
324 | 324 | # if more than one node? should rezip all of them??
|
325 |
| - assert len(logs_urls) <= 1, "Current version only supports one node per solver" |
| 325 | + assert ( |
| 326 | + len(logs_urls) <= 1 |
| 327 | + ), "Current version only supports one node per solver" # nosec |
326 | 328 | for presigned_download_link in logs_urls.values():
|
327 | 329 | logger.info(
|
328 | 330 | "Redirecting '%s' to %s ...",
|
|
0 commit comments