Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate databricks_catalogs data to Go SDK #2038

Merged
merged 2 commits into from
Feb 22, 2023
Merged

Migrate databricks_catalogs data to Go SDK #2038

merged 2 commits into from
Feb 22, 2023

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Feb 22, 2023

This PR also introduces common.WorkspaceData to reduce code boilerplate. The minimal data resource is now to be defined as:

return common.WorkspaceData(func(ctx context.Context, data *struct {
         // now even possible with inline structs!
	Ids []string `json:"ids,omitempty" tf:"computed,slice_set"`
}, w *databricks.WorkspaceClient) error {
	catalogs, err := w.Catalogs.ListAll(ctx)
	if err != nil {
		return err
	}
	for _, v := range catalogs {
		data.Ids = append(data.Ids, v.Name)
	}
	return nil
})

This PR also introduces `common.WorkspaceData` to reduce code boilerplate.
@nfx nfx merged commit 5865797 into master Feb 22, 2023
@nfx nfx deleted the sdk/catalogs-data branch February 22, 2023 18:16
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@nfx nfx mentioned this pull request Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants