From 6de31ba70972a3fc0e72659f236362dd648441b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Fonseca?= Date: Fri, 19 Aug 2022 14:22:17 +0200 Subject: [PATCH 1/4] chore(batch): deprecate sqs_batch_processor --- aws_lambda_powertools/utilities/batch/sqs.py | 9 +++++++++ docs/overrides/main.html | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/aws_lambda_powertools/utilities/batch/sqs.py b/aws_lambda_powertools/utilities/batch/sqs.py index 0848e327ea6..8d9227aa1c5 100644 --- a/aws_lambda_powertools/utilities/batch/sqs.py +++ b/aws_lambda_powertools/utilities/batch/sqs.py @@ -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 @@ -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. " + "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]: diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 0af326afb24..00dc8b152c2 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -1,5 +1,10 @@ {% extends "base.html" %} +{% block announce %} + The legacy sqs_batch_processor decorator and PartialSQSProcessor class are deprecated and are going to be removed soon. + Please check the migration guide for more information. +{% endblock %} + {% block outdated %} You're not viewing the latest version. From 520a6eab554ea9df3218b051df95822436b76fc1 Mon Sep 17 00:00:00 2001 From: Ruben Fonseca Date: Fri, 19 Aug 2022 15:35:46 +0200 Subject: [PATCH 2/4] fix(docs): wording Co-authored-by: Heitor Lessa --- aws_lambda_powertools/utilities/batch/sqs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws_lambda_powertools/utilities/batch/sqs.py b/aws_lambda_powertools/utilities/batch/sqs.py index 8d9227aa1c5..7b234c1372e 100644 --- a/aws_lambda_powertools/utilities/batch/sqs.py +++ b/aws_lambda_powertools/utilities/batch/sqs.py @@ -80,7 +80,7 @@ def __init__( warnings.warn( "The sqs_batch_processor decorator and PartialSQSProcessor class are now deprecated, " - "and will be removed in the next major version of Powertools. " + "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." From 8fd0aea9363a48c7f0e5cd9e834baf2f9f2d7146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Fonseca?= Date: Fri, 19 Aug 2022 16:47:59 +0200 Subject: [PATCH 3/4] docs(batch): change message placement --- docs/overrides/main.html | 4 ++-- docs/utilities/batch.md | 5 +++++ mkdocs.yml | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 00dc8b152c2..126a064a7ae 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -1,8 +1,8 @@ {% extends "base.html" %} {% block announce %} - The legacy sqs_batch_processor decorator and PartialSQSProcessor class are deprecated and are going to be removed soon. - Please check the migration guide for more information. + ⚠️ Powertools for Python v2 is coming soon! + We encourage you to add your feedback and follow the progress on the RFC. {% endblock %} {% block outdated %} diff --git a/docs/utilities/batch.md b/docs/utilities/batch.md index ce2e76e25d4..6241179ed4e 100644 --- a/docs/utilities/batch.md +++ b/docs/utilities/batch.md @@ -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 diff --git a/mkdocs.yml b/mkdocs.yml index 5b08b31a81d..171cf36eb13 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -47,6 +47,7 @@ theme: icon: material/toggle-switch name: Switch to light mode features: + - header.autohide - navigation.sections - navigation.expand - navigation.top From 8ffb75e3a66730e0e3446f7ae5f8d5b6d20e4d50 Mon Sep 17 00:00:00 2001 From: Heitor Lessa Date: Fri, 19 Aug 2022 19:41:41 +0200 Subject: [PATCH 4/4] Update docs/overrides/main.html --- docs/overrides/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/overrides/main.html b/docs/overrides/main.html index 126a064a7ae..e7908bbfa32 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block announce %} - ⚠️ Powertools for Python v2 is coming soon! + 👋 Powertools for Python v2 is coming soon! We encourage you to add your feedback and follow the progress on the RFC. {% endblock %}