databricks-cli/libs/dyn/convert
Pieter Noordhuis aa0c715930
Retain partially valid structs in `convert.Normalize` (#1203)
## Changes

Before this change, any error in a subtree would cause the entire
subtree to be dropped from the output.

This is not ideal when debugging, so instead we drop only the values
that cannot be normalized. Note that this doesn't change behavior if the
caller is properly checking the returned diagnostics for errors.

Note: this includes a change to use `dyn.InvalidValue` as opposed to
`dyn.NilValue` when returning errors.

## Tests

Added unit tests for the case where nested struct, map, or slice
elements contain an error.
2024-02-13 14:12:19 +00:00
..
end_to_end_test.go Fix dynamic representation of zero values in maps and slices (#1154) 2024-01-31 14:25:13 +00:00
error.go Rename libs/config -> libs/dyn (#1086) 2023-12-22 13:20:45 +00:00
from_typed.go Retain partially valid structs in `convert.Normalize` (#1203) 2024-02-13 14:12:19 +00:00
from_typed_test.go Empty struct should yield empty map in `convert.FromTyped` (#1177) 2024-02-07 09:25:07 +00:00
normalize.go Retain partially valid structs in `convert.Normalize` (#1203) 2024-02-13 14:12:19 +00:00
normalize_test.go Retain partially valid structs in `convert.Normalize` (#1203) 2024-02-13 14:12:19 +00:00
struct_info.go Rename libs/config -> libs/dyn (#1086) 2023-12-22 13:20:45 +00:00
struct_info_test.go Rename libs/config -> libs/dyn (#1086) 2023-12-22 13:20:45 +00:00
to_typed.go Zero destination struct in `convert.ToTyped` (#1178) 2024-02-07 09:25:53 +00:00
to_typed_test.go Zero destination struct in `convert.ToTyped` (#1178) 2024-02-07 09:25:53 +00:00