Skip to content

Commit 64c6192

Browse files
committed
fix: typing extension problems
1 parent e243200 commit 64c6192

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

aws_lambda_powertools/event_handler/openapi/dependant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def is_body_param(*, param_field: ModelField, is_path_param: bool) -> bool:
239239
return False
240240
else:
241241
if not isinstance(param_field.field_info, Body):
242-
raise AssertionError(f"Param: {param_field.name} can only be a request body, using Body()")
242+
raise AssertionError(f"Param: {param_field.name} can only be a request body, use Body()")
243243
return True
244244

245245

aws_lambda_powertools/shared/types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
from typing import Any, Callable, Dict, List, TypeVar, Union
33

44
if sys.version_info >= (3, 8):
5-
from typing import Literal, Protocol, TypedDict, get_args
5+
from typing import Literal, Protocol, TypedDict
66
else:
7-
from typing_extensions import Literal, Protocol, TypedDict, get_args
7+
from typing_extensions import Literal, Protocol, TypedDict
88

99
if sys.version_info >= (3, 9):
1010
from typing import Annotated
@@ -17,12 +17,12 @@
1717
from typing_extensions import NotRequired
1818

1919

20-
# Even though `get_origin` was added in Python 3.8, it only handles Annotated correctly on 3.10.
20+
# Even though `get_args` and `get_origin` were added in Python 3.8, they only handle Annotated correctly on 3.10.
2121
# So for python < 3.10 we use the backport from typing_extensions.
2222
if sys.version_info >= (3, 10):
23-
from typing import TypeAlias, get_origin
23+
from typing import TypeAlias, get_args, get_origin
2424
else:
25-
from typing_extensions import TypeAlias, get_origin
25+
from typing_extensions import TypeAlias, get_args, get_origin
2626

2727
AnyCallableT = TypeVar("AnyCallableT", bound=Callable[..., Any]) # noqa: VNE001
2828
# JSON primitives only, mypy doesn't support recursive tho

0 commit comments

Comments
 (0)