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

feat: Tasks v1 readiness part3 #3202

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 65 additions & 15 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ across different versions.
## v0.98.0 ➞ v0.99.0

### snowflake_task resource changes

new fields:
- `config`

### snowflake_tasks data source changes

New filtering options:
Expand Down Expand Up @@ -65,22 +60,41 @@ output "simple_output" {
}
```

Please adjust your Terraform configuration files.

## v0.98.0 ➞ v0.99.0

### snowflake_task resource changes
New fields:
- `config` - enables to specify JSON-formatted metadata that can be retrieved in the `sql_statement` by using [SYSTEM$GET_TASK_GRAPH_CONFIG](https://docs.snowflake.com/en/sql-reference/functions/system_get_task_graph_config).
- `show_output` and `parameters` fields added for holding SHOW and SHOW PARAMETERS output (see [raw Snowflake output](./v1-preparations/CHANGES_BEFORE_V1.md#raw-snowflake-output)).
- Added support for finalizer tasks with `finalize` field. It conflicts with `after` and `schedule` (see [finalizer tasks](https://docs.snowflake.com/en/user-guide/tasks-graphs#release-and-cleanup-of-task-graphs)).

Changes:
- `enabled` field changed to `started` and type changed to string with only boolean values available (see ["empty" values](./v1-preparations/CHANGES_BEFORE_V1.md#empty-values))
- `shedule` field changed from single value to nested object that allows for specifying either minutes or cron
- `enabled` field changed to `started` and type changed to string with only boolean values available (see ["empty" values](./v1-preparations/CHANGES_BEFORE_V1.md#empty-values)). It is also now required field, so make sure it's explicitly set (previously it was optional with the default value set to `false`).
- `allow_overlapping_execution` type was changed to string with only boolean values available (see ["empty" values](./v1-preparations/CHANGES_BEFORE_V1.md#empty-values)). Previously, it had the default set to `false` which will be migrated. If nothing will be set the provider will plan the change to `default` value. If you want to make sure it's turned off, set it explicitly to `false`.

Before:
```terraform
resource "snowflake_task" "example" {
# ...
enabled = true
# ...
}
```
After:
```terraform
resource "snowflake_task" "example" {
# ...
started = true
# ...
}
```
- `schedule` field changed from single value to a nested object that allows for specifying either minutes or cron

Before:
```terraform
resource "snowflake_task" "example" {
# ...
schedule = "5 MINUTES"
# or
schedule = "USING SCHEDULE * * * * * UTC"
schedule = "USING CRON * * * * * UTC"
# ...
}
```
Expand All @@ -96,9 +110,45 @@ resource "snowflake_task" "example" {
# ...
}
```
- All task parameters defined in [the Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters) added into the top-level schema and removed `session_paramters` map.
- `show_output` and `paramters` fields added for holding SHOW and SHOW PARAMETERS output (see [raw Snowflake output](./v1-preparations/CHANGES_BEFORE_V1.md#raw-snowflake-output)).
- Added support for finalizer tasks with `finalize` field. It conflicts with `after` and `schedule` (see [finalizer tasks](https://docs.snowflake.com/en/user-guide/tasks-graphs#release-and-cleanup-of-task-graphs)).
- All task parameters defined in [the Snowflake documentation](https://docs.snowflake.com/en/sql-reference/parameters) added into the top-level schema and removed `session_parameters` map.

Before:
```terraform
resource "snowflake_task" "example" {
# ...
session_parameters = {
QUERY_TAG = "<query_tag>"
}
# ...
}
```
After:
```terraform
resource "snowflake_task" "example" {
# ...
query_tag = "<query_tag>"
# ...
}
```

- `after` field type was changed from `list` to `set` and the values were changed from names to fully qualified names.

Before:
```terraform
resource "snowflake_task" "example" {
# ...
after = ["<task_name>", snowflake_task.some_task.name]
# ...
}
```
After:
```terraform
resource "snowflake_task" "example" {
# ...
after = ["<database_name>.<schema_name>.<task_name>", snowflake_task.some_task.fully_qualified_name]
# ...
}
```

## v0.98.0 ➞ v0.99.0

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ check "task_check" {
- `limit` (Block List, Max: 1) Limits the number of rows returned. If the `limit.from` is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with `starts_with` or `like`. (see [below for nested schema](#nestedblock--limit))
- `root_only` (Boolean) Filters the command output to return only root tasks (tasks with no predecessors).
- `starts_with` (String) Filters the output with **case-sensitive** characters indicating the beginning of the object name.
- `with_parameters` (Boolean) Runs SHOW PARAMETERS FOR TASK for each user returned by SHOW TASK. The output of describe is saved to the parameters field as a map. By default this value is set to true.
- `with_parameters` (Boolean) Runs SHOW PARAMETERS FOR TASK for each task returned by SHOW TASK and saves the output to the parameters field as a map. By default this value is set to true.

### Read-Only

Expand Down
Loading
Loading