Skip to content

Commit 43115d2

Browse files
update (#3669)
1 parent 66a881f commit 43115d2

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

jobs/resource_job.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ type JobTaskSettings struct {
219219
ExistingClusterID string `json:"existing_cluster_id,omitempty" tf:"group:cluster_type"`
220220
NewCluster *clusters.Cluster `json:"new_cluster,omitempty" tf:"group:cluster_type"`
221221
JobClusterKey string `json:"job_cluster_key,omitempty" tf:"group:cluster_type"`
222-
Libraries []compute.Library `json:"libraries,omitempty" tf:"slice_set,alias:library"`
222+
Libraries []compute.Library `json:"libraries,omitempty" tf:"alias:library"`
223223

224224
NotebookTask *NotebookTask `json:"notebook_task,omitempty" tf:"group:task_type"`
225225
SparkJarTask *SparkJarTask `json:"spark_jar_task,omitempty" tf:"group:task_type"`
@@ -294,7 +294,7 @@ type JobSettings struct {
294294
PythonWheelTask *PythonWheelTask `json:"python_wheel_task,omitempty" tf:"group:task_type"`
295295
DbtTask *DbtTask `json:"dbt_task,omitempty" tf:"group:task_type"`
296296
RunJobTask *RunJobTask `json:"run_job_task,omitempty" tf:"group:task_type"`
297-
Libraries []compute.Library `json:"libraries,omitempty" tf:"slice_set,alias:library"`
297+
Libraries []compute.Library `json:"libraries,omitempty" tf:"alias:library"`
298298
TimeoutSeconds int32 `json:"timeout_seconds,omitempty"`
299299
MaxRetries int32 `json:"max_retries,omitempty"`
300300
MinRetryIntervalMillis int32 `json:"min_retry_interval_millis,omitempty"`
@@ -631,9 +631,6 @@ func (JobSettingsResource) CustomizeSchema(s *common.CustomizableSchema) *common
631631
s.SchemaPath("job_cluster", "new_cluster", "cluster_id").SetOptional()
632632
s.SchemaPath("new_cluster", "cluster_id").SetOptional()
633633

634-
s.SchemaPath("library").Schema.Type = schema.TypeSet
635-
s.SchemaPath("task", "library").Schema.Type = schema.TypeSet
636-
637634
// Technically this is required by the API, but marking it optional since we can infer it from the hostname.
638635
s.SchemaPath("git_source", "provider").SetOptional()
639636

jobs/resource_job_test.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/databricks/terraform-provider-databricks/clusters"
1414
"github.com/databricks/terraform-provider-databricks/common"
1515
"github.com/databricks/terraform-provider-databricks/qa"
16-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1716

1817
"github.com/stretchr/testify/assert"
1918
"github.com/stretchr/testify/require"
@@ -32,10 +31,10 @@ func TestResourceJobCreate(t *testing.T) {
3231
},
3332
Libraries: []compute.Library{
3433
{
35-
Jar: "dbfs://ff/gg/hh.jar",
34+
Jar: "dbfs://aa/bb/cc.jar",
3635
},
3736
{
38-
Jar: "dbfs://aa/bb/cc.jar",
37+
Jar: "dbfs://ff/gg/hh.jar",
3938
},
4039
},
4140
Schedule: &CronSchedule{
@@ -77,10 +76,10 @@ func TestResourceJobCreate(t *testing.T) {
7776
},
7877
Libraries: []compute.Library{
7978
{
80-
Jar: "dbfs://ff/gg/hh.jar",
79+
Jar: "dbfs://aa/bb/cc.jar",
8180
},
8281
{
83-
Jar: "dbfs://aa/bb/cc.jar",
82+
Jar: "dbfs://ff/gg/hh.jar",
8483
},
8584
},
8685
Name: "Featurizer",
@@ -2021,10 +2020,10 @@ func TestResourceJobRead(t *testing.T) {
20212020
},
20222021
Libraries: []compute.Library{
20232022
{
2024-
Jar: "dbfs://ff/gg/hh.jar",
2023+
Jar: "dbfs://aa/bb/cc.jar",
20252024
},
20262025
{
2027-
Jar: "dbfs://aa/bb/cc.jar",
2026+
Jar: "dbfs://ff/gg/hh.jar",
20282027
},
20292028
},
20302029
Name: "Featurizer",
@@ -2044,7 +2043,7 @@ func TestResourceJobRead(t *testing.T) {
20442043
assert.NoError(t, err)
20452044

20462045
assert.Equal(t, "Featurizer", d.Get("name"))
2047-
libraries := d.Get("library").(*schema.Set).List()
2046+
libraries := d.Get("library").([]interface{})
20482047
assert.Len(t, libraries, 2)
20492048
allDbfsLibs := []string{}
20502049
for _, lib := range libraries {
@@ -2125,10 +2124,10 @@ func TestResourceJobUpdate(t *testing.T) {
21252124
},
21262125
Libraries: []compute.Library{
21272126
{
2128-
Jar: "dbfs://ff/gg/hh.jar",
2127+
Jar: "dbfs://aa/bb/cc.jar",
21292128
},
21302129
{
2131-
Jar: "dbfs://aa/bb/cc.jar",
2130+
Jar: "dbfs://ff/gg/hh.jar",
21322131
},
21332132
},
21342133
Name: "Featurizer New",
@@ -2152,10 +2151,10 @@ func TestResourceJobUpdate(t *testing.T) {
21522151
},
21532152
Libraries: []compute.Library{
21542153
{
2155-
Jar: "dbfs://ff/gg/hh.jar",
2154+
Jar: "dbfs://aa/bb/cc.jar",
21562155
},
21572156
{
2158-
Jar: "dbfs://aa/bb/cc.jar",
2157+
Jar: "dbfs://ff/gg/hh.jar",
21592158
},
21602159
},
21612160
Name: "Featurizer New",

0 commit comments

Comments
 (0)