Skip to content

Commit 63bdde6

Browse files
committed
chore: ignore mypy ret-type/misc caught by new typed client
1 parent d854f1c commit 63bdde6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

aws_lambda_powertools/utilities/parameters/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def _build_boto3_resource_client(
231231
session: Optional[Type[boto3.Session]] = None,
232232
config: Optional[Type[Config]] = None,
233233
endpoint_url: Optional[str] = None,
234-
) -> Type["DynamoDBServiceResource"]:
234+
) -> "DynamoDBServiceResource":
235235
"""Builds a high level boto3 resource client with session, config and endpoint_url provided
236236
237237
Parameters

aws_lambda_powertools/utilities/parameters/dynamodb.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ def _get(self, name: str, **sdk_options) -> str:
193193
# Explicit arguments will take precedence over keyword arguments
194194
sdk_options["Key"] = {self.key_attr: name}
195195

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

198200
def _get_multiple(self, path: str, **sdk_options) -> Dict[str, str]:
199201
"""
@@ -219,4 +221,6 @@ def _get_multiple(self, path: str, **sdk_options) -> Dict[str, str]:
219221
response = self.table.query(**sdk_options)
220222
items.extend(response.get("Items", []))
221223

222-
return {item[self.sort_attr]: item[self.value_attr] for item in items}
224+
# maintenance: look for better ways to correctly type DynamoDB multiple return types
225+
# without a breaking change within ABC return type
226+
return {item[self.sort_attr]: item[self.value_attr] for item in items} # type: ignore[misc]

0 commit comments

Comments
 (0)