databricks-cli/libs/dyn/merge
shreyas-goenka 068c7cfc2d
Return `dyn.InvalidValue` instead of `dyn.NilValue` when errors happen (#1514)
## Changes
With https://github.com/databricks/cli/pull/1507 and
https://github.com/databricks/cli/pull/1511 we are clarifying the
semantics associated with `dyn.InvalidValue` and `dyn.NilValue`. An
invalid value is the default zero value and is used to signals the
complete absence of the value.

A nil value, on the other hand, is a valid value for a piece of
configuration and signals explicitly setting a key to nil in the
configuration tree. In keeping with that theme, this PR returns
`dyn.InvalidValue` instead of `dyn.NilValue` at error sites. This change
is not expected to have a material change in behaviour and is being done
to set the right convention since we have well-defined semantics
associated with both `NilValue` and `InvalidValue`.

## Tests
Unit tests and integration tests pass. Also manually scanned the changes
and the associated call sites to verify the `NilValue` value itself was
not being relied upon.
2024-06-21 14:22:42 +00:00
..
elements_by_key.go Include `dyn.Path` as argument to the visit callback function (#1260) 2024-03-07 13:56:50 +00:00
elements_by_key_test.go Define `dyn.Mapping` to represent maps (#1301) 2024-03-25 11:01:09 +00:00
merge.go Return `dyn.InvalidValue` instead of `dyn.NilValue` when errors happen (#1514) 2024-06-21 14:22:42 +00:00
merge_test.go Return `dyn.InvalidValue` instead of `dyn.NilValue` when errors happen (#1514) 2024-06-21 14:22:42 +00:00
override.go Add `merge.Override` transform (#1428) 2024-05-17 09:34:39 +00:00
override_test.go Add more tests for `merge.Override` (#1439) 2024-05-21 06:48:42 +00:00