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

chore(batch): deprecate sqs_batch_processor #1463

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
9 changes: 9 additions & 0 deletions aws_lambda_powertools/utilities/batch/sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import math
import sys
import warnings
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Any, Callable, Dict, List, Optional, Tuple, cast

Expand Down Expand Up @@ -77,6 +78,14 @@ def __init__(
self.suppress_exception = suppress_exception
self.max_message_batch = 10

warnings.warn(
"The sqs_batch_processor decorator and PartialSQSProcessor class are now deprecated, "
"and will be removed in the next major version. "
"Please follow the upgrade guide at "
"https://awslabs.github.io/aws-lambda-powertools-python/latest/utilities/batch/#legacy "
"to use the native batch_processor decorator or BatchProcessor class."
)

super().__init__()

def _get_queue_url(self) -> Optional[str]:
Expand Down
5 changes: 5 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{% extends "base.html" %}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would add an announcement for the entire documentation, we'd want under batch.md instead with admonition:

???+ warning
    our message...

This type of announcement will be super useful to let people know we're going to launch v2. So perhaps rephrase to inform them that? I think it'll also need to make it auto-hide so those who already seen don't see it again: https://squidfunk.github.io/mkdocs-material/setup/setting-up-the-header/?h=announcement#automatic-hiding

{% block announce %}
👋 Powertools for Python v2 is coming soon!
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>.
{% endblock %}

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
Expand Down
5 changes: 5 additions & 0 deletions docs/utilities/batch.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ description: Utility

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

???+ warning
The legacy `sqs_batch_processor` decorator and `PartialSQSProcessor` class are deprecated and are going to be removed soon.

Please check the [migration guide](#migration-guide) for more information.

## Key Features

* Reports batch item failures to reduce number of retries for a record upon errors
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ theme:
icon: material/toggle-switch
name: Switch to light mode
features:
- header.autohide
- navigation.sections
- navigation.expand
- navigation.top
Expand Down