From e71dd19ec21eb055c206faa0c1eff22dea1a4c3a Mon Sep 17 00:00:00 2001 From: Ruben Fonseca Date: Fri, 1 Sep 2023 14:05:08 +0200 Subject: [PATCH] fix: mypy errors --- aws_lambda_powertools/utilities/idempotency/idempotency.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws_lambda_powertools/utilities/idempotency/idempotency.py b/aws_lambda_powertools/utilities/idempotency/idempotency.py index fd68c81739..d32f67ffde 100644 --- a/aws_lambda_powertools/utilities/idempotency/idempotency.py +++ b/aws_lambda_powertools/utilities/idempotency/idempotency.py @@ -4,6 +4,7 @@ import functools import logging import os +from inspect import isclass from typing import Any, Callable, Dict, Optional, Type, Union, cast from aws_lambda_powertools.middleware_factory import lambda_handler_decorator @@ -137,7 +138,7 @@ def process_order(customer_id: str, order: dict, **kwargs): ), ) - if issubclass(output_serializer, BaseIdempotencyModelSerializer): + if isclass(output_serializer) and issubclass(output_serializer, BaseIdempotencyModelSerializer): # instantiate an instance of the serializer class output_serializer = output_serializer.instantiate(function.__annotations__.get("return", None))