Skip to content

Commit a26eacf

Browse files
authored
docs(batch): fix custom batch processor example (#2714)
1 parent 66b1dc8 commit a26eacf

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

docs/utilities/batch.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ You can create your own partial batch processor from scratch by inheriting the `
346346

347347
You can then use this class as a context manager, or pass it to `batch_processor` to use as a decorator on your Lambda handler function.
348348

349-
```python hl_lines="9-12 20 35 41 48 59 64 68 76" title="Creating a custom batch processor"
349+
```python hl_lines="9-11 19 33 39 46 57 62 66 74" title="Creating a custom batch processor"
350350
--8<-- "examples/batch_processing/src/custom_partial_processor.py"
351351
```
352352

examples/batch_processing/src/custom_partial_processor.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
from aws_lambda_powertools import Logger
99
from aws_lambda_powertools.utilities.batch import (
10-
BasePartialBatchProcessor,
11-
EventType,
10+
BasePartialProcessor,
1211
process_partial_response,
1312
)
1413

@@ -17,7 +16,7 @@
1716
logger = Logger()
1817

1918

20-
class MyPartialProcessor(BasePartialBatchProcessor):
19+
class MyPartialProcessor(BasePartialProcessor):
2120
"""
2221
Process a record and stores successful results at a Amazon DynamoDB Table
2322
@@ -29,8 +28,7 @@ class MyPartialProcessor(BasePartialBatchProcessor):
2928

3029
def __init__(self, table_name: str):
3130
self.table_name = table_name
32-
33-
super().__init__(event_type=EventType.SQS)
31+
super().__init__()
3432

3533
def _prepare(self):
3634
# It's called once, *before* processing

0 commit comments

Comments
 (0)