Skip to content

Commit 1c84f71

Browse files
committed
mypy happy
1 parent 2196f3f commit 1c84f71

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

services/director/src/simcore_service_director/registry_proxy.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from collections.abc import Mapping
66
from http import HTTPStatus
77
from pprint import pformat
8-
from typing import Any, Final
8+
from typing import Any, Final, cast
99

10-
from aiocache import Cache, SimpleMemoryCache
10+
from aiocache import Cache, SimpleMemoryCache # type: ignore[import-untyped]
1111
from aiohttp import BasicAuth, ClientSession, client_exceptions
1212
from aiohttp.client import ClientTimeout
1313
from fastapi import FastAPI
@@ -205,7 +205,8 @@ async def registry_request(
205205
cache: SimpleMemoryCache = app.state.registry_cache_memory
206206
cache_key = f"{method}_{path}"
207207
if not no_cache and (cached_response := await cache.get(cache_key)):
208-
return cached_response
208+
assert isinstance(tuple[dict, Mapping], cached_response) # nosec
209+
return cast(tuple[dict, Mapping], cached_response)
209210

210211
app_settings = get_application_settings(app)
211212
response, response_headers = await _basic_auth_registry_request(

0 commit comments

Comments
 (0)