Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(batch): remove legacy sqs_batch_processor in v2 #1492

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions aws_lambda_powertools/utilities/batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@
batch_processor,
)
from aws_lambda_powertools.utilities.batch.exceptions import ExceptionInfo
from aws_lambda_powertools.utilities.batch.sqs import PartialSQSProcessor, sqs_batch_processor

__all__ = (
"BatchProcessor",
"BasePartialProcessor",
"ExceptionInfo",
"EventType",
"FailureResponse",
"PartialSQSProcessor",
"SuccessResponse",
"batch_processor",
"sqs_batch_processor",
)
8 changes: 4 additions & 4 deletions aws_lambda_powertools/utilities/batch/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,19 @@ def batch_processor(
Lambda's Context
record_handler: Callable
Callable to process each record from the batch
processor: PartialSQSProcessor
processor: BasePartialProcessor
Batch Processor to handle partial failure cases

Examples
--------
**Processes Lambda's event with PartialSQSProcessor**
**Processes Lambda's event with a BasePartialProcessor**

>>> from aws_lambda_powertools.utilities.batch import batch_processor, PartialSQSProcessor
>>> from aws_lambda_powertools.utilities.batch import batch_processor, BatchProcessor
>>>
>>> def record_handler(record):
>>> return record["body"]
>>>
>>> @batch_processor(record_handler=record_handler, processor=PartialSQSProcessor())
>>> @batch_processor(record_handler=record_handler, processor=BatchProcessor())
>>> def handler(event, context):
>>> return {"StatusCode": 200}

Expand Down
13 changes: 0 additions & 13 deletions aws_lambda_powertools/utilities/batch/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ def format_exceptions(self, parent_exception_str):
return "\n".join(exception_list)


class SQSBatchProcessingError(BaseBatchProcessingError):
"""When at least one message within a batch could not be processed"""

def __init__(self, msg="", child_exceptions: Optional[List[ExceptionInfo]] = None):
super().__init__(msg, child_exceptions)

# Overriding this method so we can output all child exception tracebacks when we raise this exception to prevent
# errors being lost. See https://github.com/awslabs/aws-lambda-powertools-python/issues/275
def __str__(self):
parent_exception_str = super(SQSBatchProcessingError, self).__str__()
return self.format_exceptions(parent_exception_str)


class BatchProcessingError(BaseBatchProcessingError):
"""When all batch records failed to be processed"""

Expand Down
250 changes: 0 additions & 250 deletions aws_lambda_powertools/utilities/batch/sqs.py

This file was deleted.

Loading