Remove try... convert of integers (E3002)
See original GitHub issueIn the property Type check, when the property value should be an integer (but it’s not), there is an attempt to convert it:
Since both YAML and JSON just handle these types out the box, the try..except
can in theory be removed (since the type’s don’t match, a string is not an integer).
Personally I like the check to be more "strict’, who do other think?
Example (JSON): https://github.com/awslabs/cfn-python-lint/blob/master/test/templates/quickstart/vpc-management.json#L816
Example (YAML): https://github.com/awslabs/cfn-python-lint/blob/master/test/templates/good/resource_properties.yaml#L464
These values can easily be written as actual integers
- CidrIp:
Ref: SSHLocation
FromPort: 22
IpProtocol: tcp
ToPort: 22
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Remove try... convert of integers (E3002) · Issue #42 - GitHub
In the property Type check, when the property value should be an integer (but it's not), there is an attempt to convert it:....
Read more >Issues with try/except, attempting to convert strings to integers ...
I've tried the try/except statements in multiple ways and none of them return a df. The current code for example returns an 'int'...
Read more >how to remove'- ' in the integer value - SQLServerCentral
The Source Column has larg Text and is of Data Type "four-byte signed integer [DT_I4]". Then when i try the RAPLACE like =...
Read more >TRY_CONVERT (Transact-SQL) - SQL Server - Microsoft Learn
The result of this statement is an error, because an integer cannot be cast into an xml data type. Copy. Explicit conversion from...
Read more >How to Convert a Python String to int
There are several ways to represent integers in Python. In this quick and practical tutorial, you'll learn how you can store integers using...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, it definitely fails to create the stack: “Value of property Value must be of type String”
aws cloudformation validate-template
succeeds with no errors either.Any change this (https://github.com/awslabs/cfn-python-lint/pull/83) is merged before the next release (https://github.com/awslabs/cfn-python-lint/pull/84)?