From cf4b05cbe9932f35ddd663f8d5a2321c8b901996 Mon Sep 17 00:00:00 2001 From: Abbas Yadollahi Date: Thu, 15 Jun 2023 11:24:41 -0700 Subject: [PATCH] docs: fix dynamodb stream event deserialize docstring --- aws_lambda_powertools/utilities/data_classes/common.py | 2 +- .../utilities/data_classes/dynamo_db_stream_event.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aws_lambda_powertools/utilities/data_classes/common.py b/aws_lambda_powertools/utilities/data_classes/common.py index ce02a4c11b0..8e2cea7a5cf 100644 --- a/aws_lambda_powertools/utilities/data_classes/common.py +++ b/aws_lambda_powertools/utilities/data_classes/common.py @@ -16,7 +16,7 @@ def __init__(self, data: Dict[str, Any], json_deserializer: Optional[Callable] = data : Dict[str, Any] Lambda Event Source Event payload json_deserializer : Callable, optional - function to deserialize `str`, `bytes`, bytearray` containing a JSON document to a Python `obj`, + function to deserialize `str`, `bytes`, `bytearray` containing a JSON document to a Python `obj`, by default json.loads """ self._data = data diff --git a/aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py b/aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py index e62e307d67a..a609dee8214 100644 --- a/aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py +++ b/aws_lambda_powertools/utilities/data_classes/dynamo_db_stream_event.py @@ -39,7 +39,7 @@ def deserialize(self, value: Dict) -> Any: -------- ------ {'NULL': True} None {'BOOL': True/False} True/False - {'N': str(value)} str(value) + {'N': Decimal(value)} Decimal(value) {'S': string} string {'B': bytes} bytes {'NS': [str(value)]} set([str(value)])