Skip to content

Fix float precision loss in jsonschema ParseFloat#4992

Open
denik wants to merge 3 commits intomainfrom
denik/random-bugfixes-3
Open

Fix float precision loss in jsonschema ParseFloat#4992
denik wants to merge 3 commits intomainfrom
denik/random-bugfixes-3

Conversation

@denik
Copy link
Copy Markdown
Contributor

@denik denik commented Apr 16, 2026

Changes

  • Fix ParseFloat to use 64-bit precision instead of 32-bit, which caused silent precision loss for float values in bundle init template prompts (e.g., 1.1 became 1.100000023841858).

Tests

  • Updated unit test to use exact float comparison, verifying the precision fix.

@denik denik requested a review from pietern April 16, 2026 14:17
@denik denik force-pushed the denik/random-bugfixes-3 branch 2 times, most recently from fc3dc36 to 6ffc4be Compare April 19, 2026 13:44
denik added 3 commits April 22, 2026 15:42
strconv.ParseFloat(s, 32) parses the string as a float32 and then
promotes it to float64, silently losing precision. For example, "1.1"
becomes 1.100000023841858 instead of 1.1. This affects users who
specify number-type template variables during `databricks bundle init`.

Change the bit size from 32 to 64 to preserve full float64 precision.

Task: 001.md

Co-authored-by: Isaac
Adds an acceptance test that renders a template with a number-type
variable (default 1.1). Prior to the ParseFloat bit-size fix the
value rendered as 1.100000023841858; with the fix it renders as 1.1.

Task: 005.md

Co-authored-by: Isaac
@denik denik force-pushed the denik/random-bugfixes-3 branch from 6ffc4be to b6f655c Compare April 22, 2026 16:09
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 this pull request may close these issues.

2 participants