Repository navigation
Conversation
convertValue fell back to reflect.Convert for numeric kinds, which truncates floats and wraps out-of-range integers. Check for precision loss and overflow, matching the rules in libs/dyn/convert. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
Integration test reportCommit: 32b9682
Top 6 slowest tests (at least 2 minutes):
|
… test Co-authored-by: Isaac <no-reply@databricks.com>
…lossy float to float Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
structaccess.Setconverted between numeric kinds withreflect.Convert, which silently truncates floats (1.9→1) and wraps out-of-range integers (int64(1<<40)intoint32→0,-1intouint). A lossy reference could deploy a wrong number.Now conversions to integer kinds return an error (e.g.
cannot set 1.9 to int: precision loss,value 1099511627776 overflows int32), following the same rules aslibs/dyn/convertnormalizeInt. Integral floats (2.0→2) still work. Conversions to float kinds stay allowed even when they round. Applies to direct and pointer targets; non-numeric conversions are unchanged.Tests
libs/structs/structaccesscovering every rule (allowed and rejected, direct and pointer targets), and astructvar.ResolveReftest showing the error surfaces.bundle/resource_deps/bad_ref_float_to_int: a float field referenced from an int field now fails planning. Existingresource_depsandvariablesgoldens are unchanged.bundle/variables/float_to_int_fieldrecords the existing${var.x}behaviour for a float variable in an int field (validate warns and drops the value); unchanged by this PR.This pull request and its description were written by Isaac.