From d60fdb8c07cbdf0b0a6e1c0857ca1c89a09e5ae3 Mon Sep 17 00:00:00 2001 From: Max Rabin Date: Thu, 8 Jan 2026 11:09:54 +0200 Subject: [PATCH] fix(batch): improve type annotation for event parameter Change event parameter type from 'dict' to 'dict[str, Any]' in process_partial_response and async_process_partial_response functions. Lambda events are JSON objects which should be typed as dict[str, Any] for better type checking with tools like pyright. Fixes #7923 --- aws_lambda_powertools/utilities/batch/decorators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws_lambda_powertools/utilities/batch/decorators.py b/aws_lambda_powertools/utilities/batch/decorators.py index 320535141fc..e818f7783a0 100644 --- a/aws_lambda_powertools/utilities/batch/decorators.py +++ b/aws_lambda_powertools/utilities/batch/decorators.py @@ -158,7 +158,7 @@ def batch_processor( def process_partial_response( - event: dict, + event: dict[str, Any], record_handler: Callable, processor: BasePartialBatchProcessor, context: LambdaContext | None = None, @@ -227,7 +227,7 @@ def handler(event, context): def async_process_partial_response( - event: dict, + event: dict[str, Any], record_handler: Callable, processor: AsyncBatchProcessor, context: LambdaContext | None = None,