Skip to content

Commit 54c051d

Browse files
authored
chore(batch): deprecate sqs_batch_processor (#1463)
1 parent 6930b42 commit 54c051d

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

aws_lambda_powertools/utilities/batch/sqs.py

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import logging
77
import math
88
import sys
9+
import warnings
910
from concurrent.futures import ThreadPoolExecutor, as_completed
1011
from typing import Any, Callable, Dict, List, Optional, Tuple, cast
1112

@@ -77,6 +78,14 @@ def __init__(
7778
self.suppress_exception = suppress_exception
7879
self.max_message_batch = 10
7980

81+
warnings.warn(
82+
"The sqs_batch_processor decorator and PartialSQSProcessor class are now deprecated, "
83+
"and will be removed in the next major version. "
84+
"Please follow the upgrade guide at "
85+
"https://awslabs.github.io/aws-lambda-powertools-python/latest/utilities/batch/#legacy "
86+
"to use the native batch_processor decorator or BatchProcessor class."
87+
)
88+
8089
super().__init__()
8190

8291
def _get_queue_url(self) -> Optional[str]:

docs/overrides/main.html

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{% extends "base.html" %}
22

3+
{% block announce %}
4+
👋 Powertools for Python v2 is coming soon!
5+
We encourage you to add your feedback and follow the progress on <a href="https://github.com/awslabs/aws-lambda-powertools-python/issues/1459">the RFC</a>.
6+
{% endblock %}
7+
38
{% block outdated %}
49
You're not viewing the latest version.
510
<a href="{{ '../' ~ base_url }}">

docs/utilities/batch.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ description: Utility
55

66
The batch processing utility handles partial failures when processing batches from Amazon SQS, Amazon Kinesis Data Streams, and Amazon DynamoDB Streams.
77

8+
???+ warning
9+
The legacy `sqs_batch_processor` decorator and `PartialSQSProcessor` class are deprecated and are going to be removed soon.
10+
11+
Please check the [migration guide](#migration-guide) for more information.
12+
813
## Key Features
914

1015
* Reports batch item failures to reduce number of retries for a record upon errors

mkdocs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ theme:
4747
icon: material/toggle-switch
4848
name: Switch to light mode
4949
features:
50+
- header.autohide
5051
- navigation.sections
5152
- navigation.expand
5253
- navigation.top

0 commit comments

Comments
 (0)