Closed
Description
What were you searching in the docs?
I wasn't sure which type of issue this is, but felt like documentation was the most appropriate.
After fetching an N
attribute from a DynamoDB StreamRecord
, I get a Decimal
object (as expected given the _deserialize_n
method), although the deserialize
docstring indicates that it should be a str
.
@event_source(data_class=DynamoDBStreamEvent)
def handler(event: DynamoDBStreamEvent, context: LambdaContext) -> None:
for record in event.records:
print(type(record.dynamodb.new_image.get("Timestamp")))
>>> <class 'decimal.Decimal'>
Is this related to an existing documentation section?
How can we improve?
Just need to update the deserializer
docstring, easy fix.
Before:
"""
{'N': str(value)} str(value)
"""
After:
"""
{'N': Decimal(value)} Decimal(value)
"""
Got a suggestion in mind?
No response
Acknowledgment
- I understand the final update might be different from my proposed suggestion, or refused.