awslabs / ec2-spot-workshops

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

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

Open devopsengineersam opened 5 months ago

devopsengineersam commented 5 months 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.