Skip to content

Commit 3cbc8d6

Browse files
committed
mypy
1 parent 2de0878 commit 3cbc8d6

File tree

2 files changed

+9
-9
lines changed
  • services/autoscaling/src/simcore_service_autoscaling/modules

2 files changed

+9
-9
lines changed

mypy.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ no_implicit_reexport = True
1313
# plugins = pydantic.mypy
1414
cache_dir = .mypy_cache
1515
error_summary = True
16-
# this would be nice to have locally but not in CI as this create a cache file
17-
; incremental = True
16+
incremental = True
17+
sqlite_cache = True
1818
local_partial_types = True
1919
no_implicit_optional = True
2020
pretty = True

services/autoscaling/src/simcore_service_autoscaling/modules/dask.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232
async def _wrap_client_async_routine(
33-
client_coroutine: Coroutine[Any, Any, Any] | Any | None
33+
client_coroutine: Coroutine[Any, Any, Any] | Any | None,
3434
) -> Any:
3535
"""Dask async behavior does not go well with Pylance as it returns
3636
a union of types. this wrapper makes both mypy and pylance happy"""
@@ -96,7 +96,7 @@ def _dask_worker_from_ec2_instance(
9696

9797
# dict is of type dask_worker_address: worker_details
9898
def _find_by_worker_host(
99-
dask_worker: tuple[DaskWorkerUrl, DaskWorkerDetails]
99+
dask_worker: tuple[DaskWorkerUrl, DaskWorkerDetails],
100100
) -> bool:
101101
_, details = dask_worker
102102
if match := re.match(DASK_NAME_PATTERN, details["name"]):
@@ -108,9 +108,9 @@ def _find_by_worker_host(
108108
raise DaskWorkerNotFoundError(
109109
worker_host=ec2_instance.aws_private_dns, url=client.scheduler.address
110110
)
111-
assert (
112-
len(filtered_workers) == 1
113-
), f"returned workers {filtered_workers}, {node_hostname=}" # nosec
111+
assert len(filtered_workers) == 1, (
112+
f"returned workers {filtered_workers}, {node_hostname=}"
113+
) # nosec
114114
return next(iter(filtered_workers.items()))
115115

116116

@@ -147,8 +147,8 @@ async def is_worker_retired(
147147

148148

149149
def _dask_key_to_dask_task_id(key: dask.typing.Key) -> DaskTaskId:
150-
if isinstance(key, bytes):
151-
return key.decode("utf-8")
150+
if isinstance(key, bytes): # type: ignore[unreachable]
151+
return key.decode("utf-8") # type: ignore[unreachable]
152152
if isinstance(key, tuple):
153153
return "(" + ", ".join(_dask_key_to_dask_task_id(k) for k in key) + ")"
154154
return f"{key}"

0 commit comments

Comments
 (0)