Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: DynamoDBStreamEvent returns NaN when working with zero numbers #4931

Closed
leandrodamascena opened this issue Aug 12, 2024 · 1 comment
Closed
Labels
bug Something isn't working triage Pending triage from maintainers

Comments

@leandrodamascena
Copy link
Contributor

Expected Behaviour

This PR #4863 intrudoced a regression when working with Zero numbers. It's now returning NaN instead of a 0 Decimal.

Current Behaviour

Returning NaN when working with 0.

Code snippet

from aws_lambda_powertools.utilities.data_classes.dynamo_db_stream_event import (
    DynamoDBStreamEvent,
    DynamoDBRecordEventName
)

def lambda_handler(event, context):
    event: DynamoDBStreamEvent = DynamoDBStreamEvent(event)
    for record in event.records:
        print(record.dynamodb.new_image)

Possible Solution

No response

Steps to Reproduce

Invoke a Lambda with DynamoDB Stream and try to access old image.

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.12

Packaging format used

PyPi

Debugging logs

No response

@leandrodamascena leandrodamascena added bug Something isn't working triage Pending triage from maintainers labels Aug 12, 2024
@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Aug 12, 2024
Copy link
Contributor

This is now released under 2.43.1 version!

@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Aug 12, 2024
@github-project-automation github-project-automation bot moved this from Triage to Coming soon in Powertools for AWS Lambda (Python) Aug 12, 2024
@leandrodamascena leandrodamascena moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python) Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Pending triage from maintainers
Projects
Status: Shipped
Development

No branches or pull requests

1 participant