File tree 1 file changed +4
-3
lines changed
aws_lambda_powertools/middleware_factory
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2
2
import inspect
3
3
import logging
4
4
import os
5
- from typing import Callable , Optional
5
+ from typing import Any , Callable , Optional
6
6
7
7
from ..shared import constants
8
8
from ..shared .functions import resolve_truthy_env_var_choice
12
12
logger = logging .getLogger (__name__ )
13
13
14
14
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 :
16
17
"""Decorator factory for decorating Lambda handlers.
17
18
18
19
You can use lambda_handler_decorator to create your own middlewares,
@@ -110,7 +111,7 @@ def lambda_handler(event, context):
110
111
)
111
112
112
113
@functools .wraps (decorator )
113
- def final_decorator (func : Optional [Callable ] = None , ** kwargs ):
114
+ def final_decorator (func : Optional [Callable ] = None , ** kwargs : Any ):
114
115
# If called with kwargs return new func with kwargs
115
116
if func is None :
116
117
return functools .partial (final_decorator , ** kwargs )
You can’t perform that action at this time.
0 commit comments