Skip to content

Commit e2a510f

Browse files
author
Michael Brewer
authored
Merge branch 'awslabs:develop' into fix-1018
2 parents a65f48a + c2f198a commit e2a510f

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format for changes and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77

8+
## 1.25.1 - 2022-02-14
9+
10+
### Bug Fixes
11+
12+
**batch:** bugfix to clear exceptions between executions ([#1022](https://github.com/awslabs/aws-lambda-powertools-python/issues/1022))
13+
814
## 1.25.0 - 2022-02-09
915

1016
### Bug Fixes

aws_lambda_powertools/utilities/batch/base.py

+1
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ def _prepare(self):
351351
"""
352352
self.success_messages.clear()
353353
self.fail_messages.clear()
354+
self.exceptions.clear()
354355
self.batch_response = copy.deepcopy(self.DEFAULT_RESPONSE)
355356

356357
def _process_record(self, record: dict) -> Union[SuccessResponse, FailureResponse]:

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "aws_lambda_powertools"
3-
version = "1.25.0"
3+
version = "1.25.1"
44
description = "A suite of utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, batching, idempotency, feature flags, and more."
55
authors = ["Amazon Web Services"]
66
include = ["aws_lambda_powertools/py.typed", "THIRD-PARTY-LICENSES"]

tests/functional/test_utilities_batch.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,16 @@ def test_batch_processor_error_when_entire_batch_fails(sqs_event_factory, record
895895
def lambda_handler(event, context):
896896
return processor.response()
897897

898-
# WHEN/THEN
898+
# WHEN calling `lambda_handler` in cold start
899899
with pytest.raises(BatchProcessingError) as e:
900900
lambda_handler(event, {})
901-
ret = str(e)
902-
assert ret is not None
901+
902+
# THEN raise BatchProcessingError
903+
assert "All records failed processing. " in str(e.value)
904+
905+
# WHEN calling `lambda_handler` in warm start
906+
with pytest.raises(BatchProcessingError) as e:
907+
lambda_handler(event, {})
908+
909+
# THEN raise BatchProcessingError
910+
assert "All records failed processing. " in str(e.value)

0 commit comments

Comments
 (0)