File tree 3 files changed +11
-3
lines changed
aws_lambda_powertools/middleware_factory
tests/functional/middleware_factory/required_dependencies
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 3
3
[`Middleware Factory`](../utilities/middleware_factory.md)
4
4
"""
5
5
6
- from .factory import lambda_handler_decorator
6
+ from aws_lambda_powertools . middleware_factory .factory import lambda_handler_decorator
7
7
8
8
__all__ = ["lambda_handler_decorator" ]
Original file line number Diff line number Diff line change 4
4
import inspect
5
5
import logging
6
6
import os
7
- from typing import Any , Callable
7
+ from typing import TYPE_CHECKING , Any
8
8
9
9
from aws_lambda_powertools .middleware_factory .exceptions import MiddlewareInvalidArgumentError
10
10
from aws_lambda_powertools .shared import constants
13
13
14
14
logger = logging .getLogger (__name__ )
15
15
16
+ if TYPE_CHECKING :
17
+ from collections .abc import Callable
18
+
16
19
17
20
# Maintenance: we can't yet provide an accurate return type without ParamSpec etc. see #1066
18
21
def lambda_handler_decorator (decorator : Callable | None = None , trace_execution : bool | None = None ) -> Callable :
Original file line number Diff line number Diff line change
1
+ from __future__ import annotations
2
+
1
3
import json
2
- from typing import Callable
4
+ from typing import TYPE_CHECKING
3
5
4
6
import pytest
5
7
8
10
MiddlewareInvalidArgumentError ,
9
11
)
10
12
13
+ if TYPE_CHECKING :
14
+ from collections .abc import Callable
15
+
11
16
12
17
@pytest .fixture
13
18
def say_hi_middleware () -> Callable :
You can’t perform that action at this time.
0 commit comments