Commit a5d0248
authored
Correctly handle zero and null values when converting typed/dynamic (#3230)
## Changes
When converting between struct and dyn.Value, respect omitempty/omitzero
and ForceSendFields. The conversion should now match what would happen
if you did json encode/decode.
## Why
There is a lot of conversion between structs and dyn.Value and
information is lost each time. This means typed structs in bundle.Config
are not completely accurate.
There consequences of this:
- In direct deployment we cannot read resource definitions from
bundle.Config, we need to go through JSON to get correct typed structs.
- Some typed code does the wrong thing, there are known and probably
some unknown cases. Example of known case:
[acceptance/bundle/resources/jobs/instance_pool_and_node_type/test.toml](https://github.com/databricks/cli/pull/3230/files#diff-f988a9ad8b0ddd1050e215cc4dbe15f834702033421f7463003075d967e2b256)1 parent 9440703 commit a5d0248
File tree
27 files changed
+224
-85
lines changed- acceptance/bundle
- integration_whl/base
- quality_monitor
- resources/jobs/instance_pool_and_node_type
- run_as
- empty_override
- empty_run_as
- templates/default-python/integration_classic
- validate
- include_locations
- job-references
- variables
- git-branch
- host
- prepend-workspace-var
- bundle
- config/mutator
- tests
- libs/dyn
- convert
27 files changed
+224
-85
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 3 | | |
12 | 4 | | |
13 | 5 | | |
| |||
23 | 15 | | |
24 | 16 | | |
25 | 17 | | |
26 | | - | |
27 | 18 | | |
28 | 19 | | |
29 | 20 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
| |||
Lines changed: 0 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments