Skip to content

Commit 89394d6

Browse files
Merge branch 'develop' into feat/idempotency-output-serializer
2 parents 1a6aa42 + e51f6ff commit 89394d6

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
## Maintenance
88

9+
* **deps:** bump squidfunk/mkdocs-material from `97da15b` to `b1f7f94` in /docs ([#3021](https://github.com/aws-powertools/powertools-lambda-python/issues/3021))
10+
* **deps:** bump docker/setup-buildx-action from 2.9.1 to 2.10.0 ([#3022](https://github.com/aws-powertools/powertools-lambda-python/issues/3022))
11+
* **deps-dev:** bump the boto-typing group with 1 update ([#3013](https://github.com/aws-powertools/powertools-lambda-python/issues/3013))
912
* **deps-dev:** bump ruff from 0.0.285 to 0.0.286 ([#3014](https://github.com/aws-powertools/powertools-lambda-python/issues/3014))
1013

1114

aws_lambda_powertools/event_handler/api_gateway.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
logger = logging.getLogger(__name__)
4242

4343
_DYNAMIC_ROUTE_PATTERN = r"(<\w+>)"
44-
_SAFE_URI = "-._~()'!*:@,;=" # https://www.ietf.org/rfc/rfc3986.txt
44+
_SAFE_URI = "-._~()'!*:@,;=+&$" # https://www.ietf.org/rfc/rfc3986.txt
4545
# API GW/ALB decode non-safe URI chars; we must support them too
4646
_UNSAFE_URI = r"%<> \[\]{}|^"
4747
_NAMED_GROUP_BOUNDARY_PATTERN = rf"(?P\1[{_SAFE_URI}{_UNSAFE_URI}\\w]+)"

aws_lambda_powertools/utilities/batch/base.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
import sys
1212
from abc import ABC, abstractmethod
1313
from enum import Enum
14-
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload
14+
from typing import Any, Callable, List, Optional, Tuple, Union, overload
1515

1616
from aws_lambda_powertools.shared import constants
1717
from aws_lambda_powertools.utilities.batch.exceptions import (
1818
BatchProcessingError,
1919
ExceptionInfo,
2020
)
21-
from aws_lambda_powertools.utilities.batch.types import BatchTypeModels
21+
from aws_lambda_powertools.utilities.batch.types import BatchTypeModels, PartialItemFailureResponse, PartialItemFailures
2222
from aws_lambda_powertools.utilities.data_classes.dynamo_db_stream_event import (
2323
DynamoDBRecord,
2424
)
@@ -220,7 +220,7 @@ def failure_handler(self, record, exception: ExceptionInfo) -> FailureResponse:
220220

221221

222222
class BasePartialBatchProcessor(BasePartialProcessor): # noqa
223-
DEFAULT_RESPONSE: Dict[str, List[Optional[dict]]] = {"batchItemFailures": []}
223+
DEFAULT_RESPONSE: PartialItemFailureResponse = {"batchItemFailures": []}
224224

225225
def __init__(self, event_type: EventType, model: Optional["BatchTypeModels"] = None):
226226
"""Process batch and partially report failed items
@@ -239,7 +239,7 @@ def __init__(self, event_type: EventType, model: Optional["BatchTypeModels"] = N
239239
"""
240240
self.event_type = event_type
241241
self.model = model
242-
self.batch_response = copy.deepcopy(self.DEFAULT_RESPONSE)
242+
self.batch_response: PartialItemFailureResponse = copy.deepcopy(self.DEFAULT_RESPONSE)
243243
self._COLLECTOR_MAPPING = {
244244
EventType.SQS: self._collect_sqs_failures,
245245
EventType.KinesisDataStreams: self._collect_kinesis_failures,
@@ -253,7 +253,7 @@ def __init__(self, event_type: EventType, model: Optional["BatchTypeModels"] = N
253253

254254
super().__init__()
255255

256-
def response(self):
256+
def response(self) -> PartialItemFailureResponse:
257257
"""Batch items that failed processing, if any"""
258258
return self.batch_response
259259

@@ -294,7 +294,7 @@ def _has_messages_to_report(self) -> bool:
294294
def _entire_batch_failed(self) -> bool:
295295
return len(self.exceptions) == len(self.records)
296296

297-
def _get_messages_to_report(self) -> List[Dict[str, str]]:
297+
def _get_messages_to_report(self) -> List[PartialItemFailures]:
298298
"""
299299
Format messages to use in batch deletion
300300
"""

tests/functional/event_handler/test_api_gateway.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ def get_network_account(account_id: str, network_id: str):
989989
[
990990
pytest.param(123456789, id="num"),
991991
pytest.param("[email protected]", id="email"),
992-
pytest.param("-._~'!*:@,;()=", id="safe-rfc3986"),
992+
pytest.param("-._~'!*:@,;()=+&$", id="safe-rfc3986"),
993993
pytest.param("%<>[]{}|^", id="unsafe-rfc3986"),
994994
],
995995
)

0 commit comments

Comments
 (0)