File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
aws_lambda_powertools/middleware_factory Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 22import inspect
33import logging
44import os
5- from typing import Callable , Optional
5+ from typing import Any , Callable , Optional
66
77from ..shared import constants
88from ..shared .functions import resolve_truthy_env_var_choice
1212logger = logging .getLogger (__name__ )
1313
1414
15- def lambda_handler_decorator (decorator : Optional [Callable ] = None , trace_execution : Optional [bool ] = None ):
15+ # Maintenance: we can't yet provide an accurate return type without ParamSpec etc. see #1066
16+ def lambda_handler_decorator (decorator : Optional [Callable ] = None , trace_execution : Optional [bool ] = None ) -> Callable :
1617 """Decorator factory for decorating Lambda handlers.
1718
1819 You can use lambda_handler_decorator to create your own middlewares,
@@ -110,7 +111,7 @@ def lambda_handler(event, context):
110111 )
111112
112113 @functools .wraps (decorator )
113- def final_decorator (func : Optional [Callable ] = None , ** kwargs ):
114+ def final_decorator (func : Optional [Callable ] = None , ** kwargs : Any ):
114115 # If called with kwargs return new func with kwargs
115116 if func is None :
116117 return functools .partial (final_decorator , ** kwargs )
You can’t perform that action at this time.
0 commit comments