Commit bff4fad
authored
Fix bundle representation for experiments (#3681)
## Changes
This PR changes the experiments resource definition to use
`ml.CreateExperiment` instead of using `ml.Experiment`.
## Why
This removes output only fields from the resource schema. Those fields
were never settable in the first place.
for reference, here are the structs:
```
type CreateExperiment struct {
// Location where all artifacts for the experiment are stored. If not
// provided, the remote server will select an appropriate default.
ArtifactLocation string `json:"artifact_location,omitempty"`
// Experiment name.
Name string `json:"name"`
// A collection of tags to set on the experiment. Maximum tag size and
// number of tags per request depends on the storage backend. All storage
// backends are guaranteed to support tag keys up to 250 bytes in size and
// tag values up to 5000 bytes in size. All storage backends are also
// guaranteed to support up to 20 tags per request.
Tags []ExperimentTag `json:"tags,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
```
```
// An experiment and its metadata.
type Experiment struct {
// Location where artifacts for the experiment are stored.
ArtifactLocation string `json:"artifact_location,omitempty"`
// Creation time
CreationTime int64 `json:"creation_time,omitempty"`
// Unique identifier for the experiment.
ExperimentId string `json:"experiment_id,omitempty"`
// Last update time
LastUpdateTime int64 `json:"last_update_time,omitempty"`
// Current life cycle stage of the experiment: "active" or "deleted".
// Deleted experiments are not returned by APIs.
LifecycleStage string `json:"lifecycle_stage,omitempty"`
// Human readable name that identifies the experiment.
Name string `json:"name,omitempty"`
// Tags: Additional metadata key-value pairs.
Tags []ExperimentTag `json:"tags,omitempty"`
ForceSendFields []string `json:"-" url:"-"`
}
```
## Tests
New integration tests are being added in
https://github.com/databricks/cli/pull/3669/files provide coverage. Just
looking at the structs though is enough to confirm that no input fields
are being lost.1 parent ec8c903 commit bff4fad
File tree
11 files changed
+23
-35
lines changed- bundle
- config
- mutator
- resourcemutator
- resources
- deploy/terraform
- tfdyn
- internal
- schema/testdata/pass
- validation/generated
- permissions
- schema
- statemgmt
11 files changed
+23
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
110 | | - | |
| 109 | + | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments