Skip to content

Commit 554e362

Browse files
authored
Upgrade databricks-sdk-go from 0.7.0 to 0.8.0 (#2259)
1 parent 0139ee6 commit 554e362

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+276
-262
lines changed

access/resource_ip_access_list_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package access
44

55
import (
66
"context"
7+
"fmt"
78
"net/http"
89
"testing"
910

@@ -270,7 +271,7 @@ func TestIPACLDelete(t *testing.T) {
270271
Fixtures: []qa.HTTPFixture{
271272
{
272273
Method: http.MethodDelete,
273-
Resource: "/api/2.0/ip-access-lists/" + TestingID,
274+
Resource: fmt.Sprintf("/api/2.0/ip-access-lists/%s?", TestingID),
274275
},
275276
},
276277
Resource: ResourceIPAccessList(),
@@ -286,7 +287,7 @@ func TestIPACLDelete_Error(t *testing.T) {
286287
Fixtures: []qa.HTTPFixture{
287288
{
288289
Method: http.MethodDelete,
289-
Resource: "/api/2.0/ip-access-lists/" + TestingID,
290+
Resource: fmt.Sprintf("/api/2.0/ip-access-lists/%s?", TestingID),
290291
Response: apierr.APIErrorBody{
291292
ErrorCode: "INVALID_STATE",
292293
Message: "Something went wrong",

access/resource_sql_permissions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strings"
88

99
"github.com/databricks/databricks-sdk-go/apierr"
10-
clustersApi "github.com/databricks/databricks-sdk-go/service/clusters"
10+
"github.com/databricks/databricks-sdk-go/service/compute"
1111
"github.com/databricks/terraform-provider-databricks/clusters"
1212
"github.com/databricks/terraform-provider-databricks/common"
1313

@@ -275,7 +275,7 @@ func (ta *SqlPermissions) getOrCreateCluster(clustersAPI clusters.ClustersAPI) (
275275
sparkVersion := clustersAPI.LatestSparkVersionOrDefault(clusters.SparkVersionRequest{
276276
Latest: true,
277277
})
278-
nodeType := clustersAPI.GetSmallestNodeType(clustersApi.NodeTypeRequest{LocalDisk: true})
278+
nodeType := clustersAPI.GetSmallestNodeType(compute.NodeTypeRequest{LocalDisk: true})
279279
aclCluster, err := clustersAPI.GetOrCreateRunningCluster(
280280
"terraform-table-acl", clusters.Cluster{
281281
ClusterName: "terraform-table-acl",

access/resource_sql_permissions_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"testing"
66

7-
clustersApi "github.com/databricks/databricks-sdk-go/service/clusters"
7+
"github.com/databricks/databricks-sdk-go/service/compute"
88
"github.com/databricks/terraform-provider-databricks/clusters"
99
"github.com/databricks/terraform-provider-databricks/common"
1010
"github.com/databricks/terraform-provider-databricks/qa"
@@ -198,14 +198,14 @@ var createHighConcurrencyCluster = []qa.HTTPFixture{
198198
Method: "GET",
199199
ReuseRequest: true,
200200
Resource: "/api/2.0/clusters/list-node-types",
201-
Response: clustersApi.ListNodeTypesResponse{
202-
NodeTypes: []clustersApi.NodeType{
201+
Response: compute.ListNodeTypesResponse{
202+
NodeTypes: []compute.NodeType{
203203
{
204204
NodeTypeId: "Standard_F4s",
205205
InstanceTypeId: "Standard_F4s",
206206
MemoryMb: 8192,
207207
NumCores: 4,
208-
NodeInstanceType: &clustersApi.NodeInstanceType{
208+
NodeInstanceType: &compute.NodeInstanceType{
209209
LocalDisks: 1,
210210
InstanceTypeId: "Standard_F4s",
211211
LocalDiskSizeGb: 16,

catalog/data_schemas.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55

66
"github.com/databricks/databricks-sdk-go"
7-
"github.com/databricks/databricks-sdk-go/service/unitycatalog"
7+
"github.com/databricks/databricks-sdk-go/service/catalog"
88
"github.com/databricks/terraform-provider-databricks/common"
99
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1010
)
@@ -14,7 +14,7 @@ func DataSourceSchemas() *schema.Resource {
1414
CatalogName string `json:"catalog_name"`
1515
Ids []string `json:"ids,omitempty" tf:"computed,slice_set"`
1616
}, w *databricks.WorkspaceClient) error {
17-
schemas, err := w.Schemas.ListAll(ctx, unitycatalog.ListSchemasRequest{CatalogName: data.CatalogName})
17+
schemas, err := w.Schemas.ListAll(ctx, catalog.ListSchemasRequest{CatalogName: data.CatalogName})
1818
if err != nil {
1919
return err
2020
}

catalog/data_tables.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55

66
"github.com/databricks/databricks-sdk-go"
7-
"github.com/databricks/databricks-sdk-go/service/unitycatalog"
7+
"github.com/databricks/databricks-sdk-go/service/catalog"
88
"github.com/databricks/terraform-provider-databricks/common"
99
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1010
)
@@ -15,7 +15,7 @@ func DataSourceTables() *schema.Resource {
1515
SchemaName string `json:"schema_name"`
1616
Ids []string `json:"ids,omitempty" tf:"computed,slice_set"`
1717
}, w *databricks.WorkspaceClient) error {
18-
tables, err := w.Tables.ListAll(ctx, unitycatalog.ListTablesRequest{CatalogName: data.CatalogName, SchemaName: data.SchemaName})
18+
tables, err := w.Tables.ListAll(ctx, catalog.ListTablesRequest{CatalogName: data.CatalogName, SchemaName: data.SchemaName})
1919
if err != nil {
2020
return err
2121
}

catalog/data_tables_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package catalog
33
import (
44
"testing"
55

6-
"github.com/databricks/databricks-sdk-go/service/unitycatalog"
6+
"github.com/databricks/databricks-sdk-go/service/catalog"
77
"github.com/databricks/terraform-provider-databricks/qa"
88
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
99
"github.com/stretchr/testify/assert"
@@ -16,8 +16,8 @@ func TestTablesData(t *testing.T) {
1616
{
1717
Method: "GET",
1818
Resource: "/api/2.1/unity-catalog/tables?catalog_name=a&schema_name=b",
19-
Response: unitycatalog.ListTablesResponse{
20-
Tables: []unitycatalog.TableInfo{
19+
Response: catalog.ListTablesResponse{
20+
Tables: []catalog.TableInfo{
2121
{
2222
FullName: "a.b.c",
2323
Name: "c",
@@ -48,8 +48,8 @@ func TestTablesDataIssue1264(t *testing.T) {
4848
{
4949
Method: "GET",
5050
Resource: "/api/2.1/unity-catalog/tables?catalog_name=a&schema_name=b",
51-
Response: unitycatalog.ListTablesResponse{
52-
Tables: []unitycatalog.TableInfo{
51+
Response: catalog.ListTablesResponse{
52+
Tables: []catalog.TableInfo{
5353
{
5454
Name: "a",
5555
FullName: "a.b.a",
@@ -80,8 +80,8 @@ func TestTablesDataIssue1264(t *testing.T) {
8080
{
8181
Method: "GET",
8282
Resource: "/api/2.1/unity-catalog/tables?catalog_name=a&schema_name=b",
83-
Response: unitycatalog.ListTablesResponse{
84-
Tables: []unitycatalog.TableInfo{
83+
Response: catalog.ListTablesResponse{
84+
Tables: []catalog.TableInfo{
8585
{
8686
Name: "c",
8787
FullName: "a.b.c",

catalog/data_views.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55

66
"github.com/databricks/databricks-sdk-go"
7-
"github.com/databricks/databricks-sdk-go/service/unitycatalog"
7+
"github.com/databricks/databricks-sdk-go/service/catalog"
88
"github.com/databricks/terraform-provider-databricks/common"
99
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1010
)
@@ -16,7 +16,7 @@ func DataSourceViews() *schema.Resource {
1616
Ids []string `json:"ids,omitempty" tf:"computed,slice_set"`
1717
}, w *databricks.WorkspaceClient) error {
1818

19-
tables, err := w.Tables.ListAll(ctx, unitycatalog.ListTablesRequest{CatalogName: data.CatalogName, SchemaName: data.SchemaName})
19+
tables, err := w.Tables.ListAll(ctx, catalog.ListTablesRequest{CatalogName: data.CatalogName, SchemaName: data.SchemaName})
2020
if err != nil {
2121
return err
2222
}

catalog/data_views_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package catalog
33
import (
44
"testing"
55

6-
"github.com/databricks/databricks-sdk-go/service/unitycatalog"
6+
"github.com/databricks/databricks-sdk-go/service/catalog"
77
"github.com/databricks/terraform-provider-databricks/qa"
88
)
99

@@ -13,8 +13,8 @@ func TestViewsData(t *testing.T) {
1313
{
1414
Method: "GET",
1515
Resource: "/api/2.1/unity-catalog/tables?catalog_name=a&schema_name=b",
16-
Response: unitycatalog.ListTablesResponse{
17-
Tables: []unitycatalog.TableInfo{
16+
Response: catalog.ListTablesResponse{
17+
Tables: []catalog.TableInfo{
1818
{
1919
CatalogName: "a",
2020
SchemaName: "b",

catalog/resource_metastore_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,7 @@ func TestDeleteMetastore(t *testing.T) {
134134
Fixtures: []qa.HTTPFixture{
135135
{
136136
Method: "DELETE",
137-
Resource: "/api/2.1/unity-catalog/metastores/abc",
138-
ExpectedRequest: map[string]bool{
139-
"force": false,
140-
},
137+
Resource: "/api/2.1/unity-catalog/metastores/abc?force=false",
141138
},
142139
},
143140
Resource: ResourceMetastore(),
@@ -155,10 +152,7 @@ func TestForceDeleteMetastore(t *testing.T) {
155152
Fixtures: []qa.HTTPFixture{
156153
{
157154
Method: "DELETE",
158-
Resource: "/api/2.1/unity-catalog/metastores/abc",
159-
ExpectedRequest: map[string]bool{
160-
"force": true,
161-
},
155+
Resource: "/api/2.1/unity-catalog/metastores/abc?force=true",
162156
},
163157
},
164158
Resource: ResourceMetastore(),

catalog/resource_sql_table.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strings"
99

1010
"github.com/databricks/databricks-sdk-go/apierr"
11-
clustersApi "github.com/databricks/databricks-sdk-go/service/clusters"
11+
"github.com/databricks/databricks-sdk-go/service/compute"
1212
"github.com/databricks/terraform-provider-databricks/clusters"
1313
"github.com/databricks/terraform-provider-databricks/common"
1414

@@ -116,7 +116,7 @@ func (ti *SqlTableInfo) getOrCreateCluster(clusterName string, clustersAPI clust
116116
sparkVersion := clustersAPI.LatestSparkVersionOrDefault(clusters.SparkVersionRequest{
117117
Latest: true,
118118
})
119-
nodeType := clustersAPI.GetSmallestNodeType(clustersApi.NodeTypeRequest{LocalDisk: true})
119+
nodeType := clustersAPI.GetSmallestNodeType(compute.NodeTypeRequest{LocalDisk: true})
120120
aclCluster, err := clustersAPI.GetOrCreateRunningCluster(
121121
clusterName, clusters.Cluster{
122122
ClusterName: clusterName,

0 commit comments

Comments
 (0)