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

Deprecate schedule block in databricks_sql_query resource #2078

Merged
merged 4 commits into from
Mar 8, 2023

Conversation

maksimyego-db
Copy link
Contributor

@maksimyego-db maksimyego-db commented Mar 7, 2023

The schedule logic will be removed in https://databricks.atlassian.net/browse/DECO-532. In this PR, I only mark the schedule stanza on the databricks_sql_query resource as deprecated.

This PR goes with the Redash API docs update in PR #272294

After the Docs update (expected by March 10-15), we'll ramp up the DFF in https://github.com/databricks/universe/pull/272189 to respond with http status 410 to any REST API request related to Redash schedules, expected around March 15.

Close #1963

@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2023

Codecov Report

Merging #2078 (de3ccca) into master (bd05be2) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2078      +/-   ##
==========================================
- Coverage   89.78%   89.72%   -0.07%     
==========================================
  Files         136      136              
  Lines       11077    11085       +8     
==========================================
  Hits         9946     9946              
- Misses        732      736       +4     
- Partials      399      403       +4     
Impacted Files Coverage Δ
sql/api/query.go 75.40% <ø> (ø)
sql/resource_sql_query.go 95.81% <100.00%> (+0.01%) ⬆️
repos/resource_git_credential.go 88.57% <0.00%> (-11.43%) ⬇️
catalog/resource_share.go 95.00% <0.00%> (-0.13%) ⬇️
catalog/data_shares.go 100.00% <0.00%> (ø)

@allebacco
Copy link

Is there any plan to deprecate also the schedule logic of SQL Dashboards and SQL Alerts?

@maksimyego-db
Copy link
Contributor Author

maksimyego-db commented Mar 7, 2023

any plan to deprecate also the schedule logic of SQL Dashboards and SQL Alerts?

That's correct, API operations on Redash schedules on all of {query,dashboard,alert} are deprecated. New schedules can be created via sql_task in the Jobs API. Related thread in #jobs-dbsql-discuss: They're already deprecated (will return 410 response) in http://go/redash/workspace in dev-aws-us-west-2.
Deprecation notice previously published on public docs in https://docs.databricks.com/sql/api/queries-dashboards.html (search under "deprecated", ditto for Azure and GCP docs).

docs/resources/sql_query.md Outdated Show resolved Hide resolved
@@ -12,6 +12,7 @@ type Query struct {
Name string `json:"name"`
Description string `json:"description"`
Query string `json:"query"`
// Deprecated: Use databricks_job resource to schedule a Query
Copy link
Contributor

Choose a reason for hiding this comment

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

this won't have any effect, please use SchemaPath to set Deprecated flag to true in the relevant StructToSchema blocks

if v, err := common.SchemaPath(s, "aws_attributes", "availability"); err == nil {
v.Default = clusters.AwsAvailabilitySpot
v.ValidateFunc = validation.StringInSlice([]string{
clusters.AwsAvailabilityOnDemand,
clusters.AwsAvailabilitySpot,
}, false)
}

Copy link
Contributor Author

@maksimyego-db maksimyego-db Mar 7, 2023

Choose a reason for hiding this comment

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

Thanks, I had https://github.com/golang/go/wiki/Deprecated in mind when adding // Deprecated: (other links in golang/go#10909). Updated SchemaPath

@maksimyego-db maksimyego-db requested a review from nfx March 7, 2023 17:42
@nkvuong nkvuong changed the title [REDASH-4424] Add deprecation note to databricks_sql_query terraform resource docs Deprecate schedule block in databricks_sql_query resource Mar 8, 2023
@nfx nfx merged commit 58da0d5 into databricks:master Mar 8, 2023
nfx added a commit that referenced this pull request Mar 9, 2023
* Added databricks_model_serving resource (#2054).
* Added Unity Catalog on GCP support (#2000).
* Deprecate schedule block in databricks_sql_query resource (#2078).
* Fixed InitScripts Type to work with GCS and ABFS in databricks_cluster resource (#2067).
* Added more testing for databricks_tables data source (#2075).
* Added more testing for databricks_schemas data source (#2074).
* Migrate databricks_node_type data source to Go SDK (#2070).
* Migrate databricks_schemas data to Go SDK (#2065).
* Migrate databricks_tables data source to SDK (#2068).
* Migrate databricks_views data source to Go SDK (#2073).
* Migrated databricks_git_credential to Go SDK (#2069).
* Migrated databricks_shares data source to Go SDK (#2072).

Updated dependency versions:

* Bump github.com/databricks/databricks-sdk-go from v0.3.3 to v0.4.0 (#2086).
* Bump golang.org/x/mod from 0.8.0 to 0.9.0 (#2076).
@nfx nfx mentioned this pull request Mar 9, 2023
nfx added a commit that referenced this pull request Mar 9, 2023
* Added databricks_model_serving resource (#2054).
* Added Unity Catalog on GCP support (#2000).
* Deprecate schedule block in databricks_sql_query resource (#2078).
* Fixed InitScripts Type to work with GCS and ABFS in databricks_cluster resource (#2067).
* Added more testing for databricks_tables data source (#2075).
* Added more testing for databricks_schemas data source (#2074).
* Migrate databricks_node_type data source to Go SDK (#2070).
* Migrate databricks_schemas data to Go SDK (#2065).
* Migrate databricks_tables data source to SDK (#2068).
* Migrate databricks_views data source to Go SDK (#2073).
* Migrated databricks_git_credential to Go SDK (#2069).
* Migrated databricks_shares data source to Go SDK (#2072).

Updated dependency versions:

* Bump github.com/databricks/databricks-sdk-go from v0.3.3 to v0.4.0 (#2086).
* Bump golang.org/x/mod from 0.8.0 to 0.9.0 (#2076).
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.

[ISSUE] Deprecate schedule attribute on SQL resources
4 participants