Skip to content

Commit e254b5a

Browse files
authored
[Internal] Unified Terraform Provider: BugFix for Notebook Data source (#5173)
## Changes <!-- Summary of your changes that are easy to understand --> Newly generated DatabricksClient is only for resources / data sources not using Go SDK. This data source has some parts some are using Go SDK and some which don't. We would have proper fix to prevent this by adding a marker in the newly Generated DatabricksClient which would prevent usage of these clients by other methods. This would first need a change internally. Will create this in a separate PR. ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> CI Tests NO_CHANGELOG=true
1 parent 4e0d459 commit e254b5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

workspace/data_notebook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ func DataSourceNotebook() common.Resource {
5656
return common.Resource{
5757
Schema: s,
5858
Read: func(ctx context.Context, d *schema.ResourceData, m *common.DatabricksClient) error {
59-
m, err := m.DatabricksClientForUnifiedProvider(ctx, d)
59+
newClient, err := m.DatabricksClientForUnifiedProvider(ctx, d)
6060
if err != nil {
6161
return err
6262
}
6363
w, err := m.WorkspaceClientUnifiedProvider(ctx, d)
6464
if err != nil {
6565
return err
6666
}
67-
notebooksAPI := NewNotebooksAPI(ctx, m)
67+
notebooksAPI := NewNotebooksAPI(ctx, newClient)
6868
path := d.Get("path").(string)
6969
format := d.Get("format").(string)
7070
notebookContent, err := notebooksAPI.Export(path, format)

0 commit comments

Comments
 (0)