Skip to content

Commit c83c635

Browse files
committed
refactor(batch): remove legacy sqs_batch_processor (#1492)
1 parent 90b45aa commit c83c635

File tree

8 files changed

+101
-971
lines changed

8 files changed

+101
-971
lines changed

aws_lambda_powertools/utilities/batch/__init__.py

-6
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,13 @@
1313
batch_processor,
1414
)
1515
from aws_lambda_powertools.utilities.batch.exceptions import ExceptionInfo
16-
from aws_lambda_powertools.utilities.batch.sqs import (
17-
PartialSQSProcessor,
18-
sqs_batch_processor,
19-
)
2016

2117
__all__ = (
2218
"BatchProcessor",
2319
"BasePartialProcessor",
2420
"ExceptionInfo",
2521
"EventType",
2622
"FailureResponse",
27-
"PartialSQSProcessor",
2823
"SuccessResponse",
2924
"batch_processor",
30-
"sqs_batch_processor",
3125
)

aws_lambda_powertools/utilities/batch/base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,19 @@ def batch_processor(
208208
Lambda's Context
209209
record_handler: Callable
210210
Callable to process each record from the batch
211-
processor: PartialSQSProcessor
211+
processor: BasePartialProcessor
212212
Batch Processor to handle partial failure cases
213213
214214
Examples
215215
--------
216-
**Processes Lambda's event with PartialSQSProcessor**
216+
**Processes Lambda's event with a BasePartialProcessor**
217217
218-
>>> from aws_lambda_powertools.utilities.batch import batch_processor, PartialSQSProcessor
218+
>>> from aws_lambda_powertools.utilities.batch import batch_processor, BatchProcessor
219219
>>>
220220
>>> def record_handler(record):
221221
>>> return record["body"]
222222
>>>
223-
>>> @batch_processor(record_handler=record_handler, processor=PartialSQSProcessor())
223+
>>> @batch_processor(record_handler=record_handler, processor=BatchProcessor())
224224
>>> def handler(event, context):
225225
>>> return {"StatusCode": 200}
226226

aws_lambda_powertools/utilities/batch/exceptions.py

-13
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,6 @@ def format_exceptions(self, parent_exception_str):
2424
return "\n".join(exception_list)
2525

2626

27-
class SQSBatchProcessingError(BaseBatchProcessingError):
28-
"""When at least one message within a batch could not be processed"""
29-
30-
def __init__(self, msg="", child_exceptions: Optional[List[ExceptionInfo]] = None):
31-
super().__init__(msg, child_exceptions)
32-
33-
# Overriding this method so we can output all child exception tracebacks when we raise this exception to prevent
34-
# errors being lost. See https://github.com/awslabs/aws-lambda-powertools-python/issues/275
35-
def __str__(self):
36-
parent_exception_str = super(SQSBatchProcessingError, self).__str__()
37-
return self.format_exceptions(parent_exception_str)
38-
39-
4027
class BatchProcessingError(BaseBatchProcessingError):
4128
"""When all batch records failed to be processed"""
4229

aws_lambda_powertools/utilities/batch/sqs.py

-250
This file was deleted.

0 commit comments

Comments
 (0)