From 294598b3433cc7916f8806ac7cc0110700afab4e Mon Sep 17 00:00:00 2001 From: Pedro Crespo-Valero <32402063+pcrespov@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:44:08 +0200 Subject: [PATCH] fixes key builders --- .../catalog/_models.py | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 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 55b065c0b497..eded58cc0a46 100644 --- a/services/web/server/src/simcore_service_webserver/catalog/_models.py +++ b/services/web/server/src/simcore_service_webserver/catalog/_models.py @@ -59,13 +59,11 @@ def get_html_formatted_unit( _CACHE_TTL: Final = 1 * _MINUTE -def _hash_inputs( - service: dict[str, Any], - input_key: str, - *args, # noqa: ARG001 # pylint: disable=unused-argument - **kwargs, # noqa: ARG001 # pylint: disable=unused-argument -): - return f"{service['key']}/{service['version']}/{input_key}" +def _hash_inputs(_f, *_args, **kw): + assert _f.__name__ # nosec + assert not _args # nosec + service: dict[str, Any] = kw["service"] + return f"ServiceInputGetFactory_{service['key']}_{service['version']}_{kw['input_key']}" class ServiceInputGetFactory: @@ -95,13 +93,11 @@ async def from_catalog_service_api_model( return port -def _hash_outputs( - service: dict[str, Any], - output_key: str, - *args, # noqa: ARG001 # pylint: disable=unused-argument - **kwargs, # noqa: ARG001 # pylint: disable=unused-argument -): - return f"{service['key']}/{service['version']}/{output_key}" +def _hash_outputs(_f, *_args, **kw): + assert _f.__name__ # nosec + assert not _args # nosec + service: dict[str, Any] = kw["service"] + return f"ServiceOutputGetFactory_{service['key']}/{service['version']}/{kw['output_key']}" class ServiceOutputGetFactory: