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 1 commit
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 of Powertools. "
rubenfonseca marked this conversation as resolved.
Show resolved Hide resolved
"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 %}
The legacy <code>sqs_batch_processor</code> decorator and <code>PartialSQSProcessor</code> class are deprecated and are going to be removed soon.
Please check the <a href="/utilities/batch/#migration-guide">migration guide</a> for more information.
{% endblock %}

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
Expand Down