Skip to content

Commit

Permalink
[Fix] Add validation for run_as_mode in databricks_query (#4233)
Browse files Browse the repository at this point in the history
## Changes
<!-- Summary of your changes that are easy to understand -->

Resolves #4228

## Tests
<!-- 
How is this tested? Please see the checklist below and also describe any
other relevant tests
-->

- [x] `make test` run locally
- [x] relevant change in `docs/` folder
- [ ] covered with integration tests in `internal/acceptance`
- [ ] relevant acceptance tests are passing
- [ ] using Go SDK
  • Loading branch information
alexott authored Nov 16, 2024
1 parent 27ff289 commit 7fc5b6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/resources/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The following arguments are available:
* `catalog` - (Optional, String) Name of the catalog where this query will be executed.
* `schema` - (Optional, String) Name of the schema where this query will be executed.
* `description` - (Optional, String) General description that conveys additional information about this query such as usage notes.
* `run_as_mode` - (Optional, String) Sets the "Run as" role for the object.
* `run_as_mode` - (Optional, String) Sets the "Run as" role for the object. Should be one of `OWNER`, `VIEWER`.
* `tags` - (Optional, List of strings) Tags that will be added to the query.
* `parameter` - (Optional, Block) Query parameter definition. Consists of following attributes (one of `*_value` is required):
* `name` - (Required, String) Literal parameter marker that appears between double curly braces in the query text.
Expand Down
4 changes: 1 addition & 3 deletions sql/resource_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ func (QueryStruct) CustomizeSchema(m *common.CustomizableSchema) *common.Customi
m.SchemaPath("warehouse_id").SetRequired().SetValidateFunc(validation.StringIsNotWhiteSpace)
m.SchemaPath("parent_path").SetCustomSuppressDiff(common.WorkspaceOrEmptyPathPrefixDiffSuppress).SetForceNew()
m.SchemaPath("owner_user_name").SetSuppressDiff()
m.SchemaPath("run_as_mode").SetSuppressDiff()
//m.SchemaPath("").SetSuppressDiff()
//m.SchemaPath("").SetSuppressDiff()
m.SchemaPath("run_as_mode").SetSuppressDiff().SetValidateFunc(validation.StringInSlice([]string{"VIEWER", "OWNER"}, false))
m.SchemaPath("id").SetReadOnly()
m.SchemaPath("create_time").SetReadOnly()
m.SchemaPath("lifecycle_state").SetReadOnly()
Expand Down

0 comments on commit 7fc5b6a

Please sign in to comment.