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

Not handling floating numbers #188

Closed
j2cagle opened this issue Feb 8, 2025 · 0 comments · Fixed by #191
Closed

Not handling floating numbers #188

j2cagle opened this issue Feb 8, 2025 · 0 comments · Fixed by #191
Assignees

Comments

@j2cagle
Copy link

j2cagle commented Feb 8, 2025

Here are some terraform examples of what triggers the error:
locals { issue1 = 12345 * 0.5 issue2 = floor(429496729.6) }

The error:
RuntimeError: Invalid type to convert to inline HCL: <class 'float'>

Potential fix?:
https://github.com/amplify-education/python-hcl2/blob/main/hcl2/transformer.py#L352

        if isinstance(value, float):
            return str(value)

Workaround:
No found workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants