awslabs / ec2-spot-workshops

Collection of workshops to demonstrate best practices in using Amazon EC2 Spot Instances. https://aws.amazon.com/ec2/spot/
Other
181 stars 150 forks source link

Update stack.yaml: Handle the case where pv cannot be converted to float #286

Open devopsengineersam opened 1 month ago

devopsengineersam commented 1 month ago

Got an error: "Could not convert string to float"

Issue #, if available:

Description of changes:

  1. The pair.get("pv", "0") ensures that if pv is missing, it defaults to "0"

  2. The try block attempts to convert pv to a float and adds it to the aggregation. If the conversion fails, it prints a message and skips the invalid value

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.