Skip to content

Commit bd651c6

Browse files
Making mypy happy
1 parent 4d19ede commit bd651c6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

aws_lambda_powertools/utilities/data_classes/api_gateway_authorizer_event.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(
2828
aws_account_id: str,
2929
api_id: str,
3030
stage: str,
31-
http_method: str,
31+
http_method: str | None,
3232
resource: str,
3333
partition: str = "aws",
3434
is_websocket_authorizer: bool = False,
@@ -666,8 +666,9 @@ def from_route_arn(
666666
usage_identifier_key,
667667
)
668668

669+
# Note: we need ignore[override] because we are removing the http_method field
669670
@override
670-
def _add_route(self, effect: str, resource: str, conditions: list[dict] | None = None):
671+
def _add_route(self, effect: str, resource: str, conditions: list[dict] | None = None): # type: ignore[override]
671672
"""Adds a route to the internal lists of allowed or denied routes. Each object in
672673
the internal list contains a resource ARN and a condition statement. The condition
673674
statement can be null."""
@@ -700,8 +701,9 @@ def deny_all_routes(self):
700701

701702
self._add_route(effect="Deny", resource="*")
702703

704+
# Note: we need ignore[override] because we are removing the http_method field
703705
@override
704-
def allow_route(self, resource: str, conditions: list[dict] | None = None):
706+
def allow_route(self, resource: str, conditions: list[dict] | None = None): # type: ignore[override]
705707
"""
706708
Add an API Gateway Websocket method to the list of allowed methods for the policy.
707709
@@ -728,8 +730,9 @@ def allow_route(self, resource: str, conditions: list[dict] | None = None):
728730
"""
729731
self._add_route(effect="Allow", resource=resource, conditions=conditions)
730732

733+
# Note: we need ignore[override] because we are removing the http_method field
731734
@override
732-
def deny_route(self, resource: str, conditions: list[dict] | None = None):
735+
def deny_route(self, resource: str, conditions: list[dict] | None = None): # type: ignore[override]
733736
"""
734737
Add an API Gateway Websocket method to the list of allowed methods for the policy.
735738

0 commit comments

Comments
 (0)