Skip to content

Commit 4602ffc

Browse files
maxrabinMax Rabinleandrodamascena
authored
refactor(batch): improve type annotation for event parameter (#7924)
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 Co-authored-by: Max Rabin <[email protected]> Co-authored-by: Leandro Damascena <[email protected]>
1 parent e920250 commit 4602ffc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws_lambda_powertools/utilities/batch/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def batch_processor(
158158

159159

160160
def process_partial_response(
161-
event: dict,
161+
event: dict[str, Any],
162162
record_handler: Callable,
163163
processor: BasePartialBatchProcessor,
164164
context: LambdaContext | None = None,
@@ -227,7 +227,7 @@ def handler(event, context):
227227

228228

229229
def async_process_partial_response(
230-
event: dict,
230+
event: dict[str, Any],
231231
record_handler: Callable,
232232
processor: AsyncBatchProcessor,
233233
context: LambdaContext | None = None,

0 commit comments

Comments
 (0)