Skip to content

Commit 56b9f1e

Browse files
Addressing Andrea's feedback
1 parent b13dcfc commit 56b9f1e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

aws_lambda_powertools/utilities/batch/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def __init__(
226226
self,
227227
event_type: EventType,
228228
model: Optional["BatchTypeModels"] = None,
229-
raise_on_entire_batch_fail: bool = True,
229+
raise_on_entire_batch_failure: bool = True,
230230
):
231231
"""Process batch and partially report failed items
232232
@@ -247,7 +247,7 @@ def __init__(
247247
"""
248248
self.event_type = event_type
249249
self.model = model
250-
self.raise_on_entire_batch_fail = raise_on_entire_batch_fail
250+
self.raise_on_entire_batch_fail = raise_on_entire_batch_failure
251251
self.batch_response: PartialItemFailureResponse = copy.deepcopy(self.DEFAULT_RESPONSE)
252252
self._COLLECTOR_MAPPING = {
253253
EventType.SQS: self._collect_sqs_failures,
@@ -484,7 +484,7 @@ def lambda_handler(event, context: LambdaContext):
484484
Raises
485485
------
486486
BatchProcessingError
487-
When all batch records fail processing and raise_on_entire_batch_fail is True
487+
When all batch records fail processing and raise_on_entire_batch_failure is True
488488
489489
Limitations
490490
-----------
@@ -633,7 +633,7 @@ def lambda_handler(event, context: LambdaContext):
633633
Raises
634634
------
635635
BatchProcessingError
636-
When all batch records fail processing and raise_on_entire_batch_fail is True
636+
When all batch records fail processing and raise_on_entire_batch_failure is True
637637
638638
Limitations
639639
-----------

docs/utilities/batch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ By default, the `BatchProcessor` will raise `BatchProcessingError` if all record
497497

498498
When working with functions that handle batches with a small number of records, or when you use errors as a flow control mechanism, this behavior might not be desirable as your function might generate an unnaturally high number of errors. When this happens, the [Lambda service will scale down the concurrency of your function](https://docs.aws.amazon.com/lambda/latest/dg/services-sqs-errorhandling.html#services-sqs-backoff-strategy){target="_blank"}, potentially impacting performance.
499499

500-
For these scenarios, you can set the `raise_on_entire_batch_fail` option to `False`.
500+
For these scenarios, you can set the `raise_on_entire_batch_failure` option to `False`.
501501

502502
=== "working_with_entire_batch_fail.py"
503503

examples/batch_processing/src/working_with_entire_batch_fail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from aws_lambda_powertools.utilities.data_classes.sqs_event import SQSRecord
88
from aws_lambda_powertools.utilities.typing import LambdaContext
99

10-
processor = BatchProcessor(event_type=EventType.SQS, raise_on_entire_batch_fail=False)
10+
processor = BatchProcessor(event_type=EventType.SQS, raise_on_entire_batch_failure=False)
1111
tracer = Tracer()
1212
logger = Logger()
1313

tests/functional/batch/required_dependencies/test_utilities_batch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def test_batch_processor_not_raise_when_entire_batch_fails_sync(sqs_event_factor
414414
event = {"Records": [first_record.raw_event, second_record.raw_event]}
415415

416416
# GIVEN the BatchProcessor constructor with raise_on_entire_batch_fail False
417-
processor = BatchProcessor(event_type=EventType.SQS, raise_on_entire_batch_fail=False)
417+
processor = BatchProcessor(event_type=EventType.SQS, raise_on_entire_batch_failure=False)
418418

419419
# WHEN processing the messages
420420
@batch_processor(record_handler=record_handler, processor=processor)
@@ -435,7 +435,7 @@ def test_batch_processor_not_raise_when_entire_batch_fails_async(sqs_event_facto
435435
event = {"Records": [first_record.raw_event, second_record.raw_event]}
436436

437437
# GIVEN the BatchProcessor constructor with raise_on_entire_batch_fail False
438-
processor = AsyncBatchProcessor(event_type=EventType.SQS, raise_on_entire_batch_fail=False)
438+
processor = AsyncBatchProcessor(event_type=EventType.SQS, raise_on_entire_batch_failure=False)
439439

440440
# WHEN processing the messages
441441
@async_batch_processor(record_handler=record_handler, processor=processor)

0 commit comments

Comments
 (0)