Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def from_route_arn(

# Note: we need ignore[override] because we are removing the http_method field
@override
def _add_route(self, effect: str, resource: str, conditions: list[dict] | None = None): # type: ignore[override]
def _add_route(self, effect: str, resource: str, conditions: list[dict] | None = None): # type: ignore[override] # ty: ignore[invalid-method-override]
"""Adds a route to the internal lists of allowed or denied routes. Each object in
the internal list contains a resource ARN and a condition statement. The condition
statement can be null."""
Expand Down Expand Up @@ -703,7 +703,7 @@ def deny_all_routes(self, http_method: str = HttpVerb.ALL.value): # type: ignor

# Note: we need ignore[override] because we are removing the http_method field
@override
def allow_route(self, resource: str, conditions: list[dict] | None = None): # type: ignore[override]
def allow_route(self, resource: str, conditions: list[dict] | None = None): # type: ignore[override] # ty: ignore[invalid-method-override]
"""
Add an API Gateway Websocket method to the list of allowed methods for the policy.

Expand Down Expand Up @@ -732,7 +732,7 @@ def allow_route(self, resource: str, conditions: list[dict] | None = None): # t

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

Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_powertools/utilities/data_classes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _str_helper(self) -> dict[str, Any]:
properties = self._properties()
sensitive_properties = ["raw_event"]
if hasattr(self, "_sensitive_properties"):
sensitive_properties.extend(self._sensitive_properties) # pyright: ignore # type: ignore[arg-type]
sensitive_properties.extend(self._sensitive_properties) # pyright: ignore # type: ignore[arg-type] # ty: ignore[invalid-argument-type]

result: dict[str, Any] = {}
for property_key in properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,5 +432,5 @@ def _lookup_exception_handler(self, exc: BaseException) -> Callable | None:
# of an exception
for cls in type(exc).__mro__:
if cls in self._exception_handlers:
return self._exception_handlers[cls] # type: ignore[index] # index is correct
return self._exception_handlers[cls] # type: ignore[index] # ty: ignore[invalid-argument-type]
return None
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import logging
from typing import Any

from google.protobuf.internal.decoder import _DecodeSignedVarint # type: ignore[attr-defined]
from google.protobuf.internal.decoder import ( # type: ignore[attr-defined]
_DecodeSignedVarint, # ty: ignore[unresolved-import]
)
from google.protobuf.json_format import MessageToDict

from aws_lambda_powertools.utilities.kafka.deserializer.base import DeserializerBase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import logging
import os
import urllib.error
import urllib.request
from dataclasses import dataclass, field
from json import JSONDecodeError
Expand Down
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/parameters/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def _get(self, name: str, **sdk_options) -> str:

# maintenance: look for better ways to correctly type DynamoDB multiple return types
# without a breaking change within ABC return type
return self.table.get_item(**sdk_options)["Item"][self.value_attr] # type: ignore[return-value]
return self.table.get_item(**sdk_options)["Item"][self.value_attr] # type: ignore[return-value] # ty: ignore[invalid-return-type]

def _get_multiple(self, path: str, **sdk_options) -> dict[str, str]:
"""
Expand Down Expand Up @@ -230,4 +230,4 @@ def _get_multiple(self, path: str, **sdk_options) -> dict[str, str]:

# maintenance: look for better ways to correctly type DynamoDB multiple return types
# without a breaking change within ABC return type
return {item[self.sort_attr]: item[self.value_attr] for item in items} # type: ignore[misc]
return {item[self.sort_attr]: item[self.value_attr] for item in items} # type: ignore[misc] # ty: ignore[invalid-return-type]
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/parameters/secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def _get(self, name: str, **sdk_options) -> str | bytes:

return secret_value["SecretBinary"]

def _get_multiple(self, names: list[str], **sdk_options) -> dict[str, Any]: # type: ignore[override]
def _get_multiple(self, names: list[str], **sdk_options) -> dict[str, Any]: # type: ignore[override] # ty: ignore[invalid-method-override]
"""
Retrieve multiple secrets using AWS Secrets Manager batch_get_secret_value API

Expand Down Expand Up @@ -200,7 +200,7 @@ def _get_multiple(self, names: list[str], **sdk_options) -> dict[str, Any]: # t

return secrets

def get_multiple( # type: ignore[override]
def get_multiple( # type: ignore[override] # ty: ignore[invalid-method-override]
self,
names: list[str],
max_age: int | None = None,
Expand Down
4 changes: 2 additions & 2 deletions aws_lambda_powertools/utilities/parameters/ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def __init__(

super().__init__(client=self.client)

def get_multiple( # type: ignore[override]
def get_multiple( # type: ignore[override] # ty: ignore[invalid-method-override]
self,
path: str,
max_age: int | None = None,
Expand Down Expand Up @@ -192,7 +192,7 @@ def get_multiple( # type: ignore[override]

# We break Liskov substitution principle due to differences in signatures of this method and superclass get method
# We ignore mypy error, as changes to the signature here or in a superclass is a breaking change to users
def get( # type: ignore[override]
def get( # type: ignore[override] # ty: ignore[invalid-method-override]
self,
name: str,
max_age: int | None = None,
Expand Down
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ mkdocs-llmstxt = ">=0.2,<0.5"
avro = "^1.12.0"
protobuf = ">=6.30.2,<8.0.0"
types-protobuf = "^6.30.2.20250516"
ty = "^0.0.23"
ty = ">=0.0.23,<0.0.28"

[tool.coverage.run]
source = ["aws_lambda_powertools"]
Expand Down
Loading