From 6028ddad05f22e8016e973b8c15c3883710a29ff Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:42:32 +0200 Subject: [PATCH] @sanderegg review: annotated and rm assert --- .../src/simcore_service_webserver/catalog/_models.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/services/web/server/src/simcore_service_webserver/catalog/_models.py b/services/web/server/src/simcore_service_webserver/catalog/_models.py index 0398b243250..5c4235350a6 100644 --- a/services/web/server/src/simcore_service_webserver/catalog/_models.py +++ b/services/web/server/src/simcore_service_webserver/catalog/_models.py @@ -1,6 +1,6 @@ import logging from dataclasses import dataclass -from typing import Any, Final +from typing import Any, Callable, Final from aiocache import cached from models_library.api_schemas_webserver.catalog import ( @@ -61,8 +61,7 @@ def get_html_formatted_unit( _CACHE_TTL: Final = 1 * _MINUTE -def _hash_inputs(_f, *_args, **kw): - assert _f.__name__ # nosec +def _hash_inputs(_f: Callable[..., Any], *_args, **kw): assert not _args # nosec service: dict[str, Any] = kw["service"] return f"ServiceInputGetFactory_{service['key']}_{service['version']}_{kw['input_key']}" @@ -95,8 +94,7 @@ async def from_catalog_service_api_model( return port -def _hash_outputs(_f, *_args, **kw): - assert _f.__name__ # nosec +def _hash_outputs(_f: Callable[..., Any], *_args, **kw): assert not _args # nosec service: dict[str, Any] = kw["service"] return f"ServiceOutputGetFactory_{service['key']}/{service['version']}/{kw['output_key']}"