Skip to content

Commit

Permalink
@sanderegg review: annotated and rm assert
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Aug 13, 2024
1 parent 0295589 commit 6028dda
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -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']}"
Expand Down Expand Up @@ -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']}"
Expand Down

0 comments on commit 6028dda

Please sign in to comment.