-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dbeatty/fix-553
- Loading branch information
Showing
40 changed files
with
486 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## dbt-redshift 1.7.0-b2 - September 15, 2023 | ||
|
||
### Features | ||
|
||
- use get_replace_sql in redshift__get_alter_materialized_view_as_sql, avoid renaming materialized views with custom table.sql and view.sql ([#606](https://github.com/dbt-labs/dbt-redshift/issues/606)) | ||
|
||
### Fixes | ||
|
||
- allow auto_refresh to take in boolean and str values for materialized views ([#560](https://github.com/dbt-labs/dbt-redshift/issues/560)) | ||
- Fix to support removal of hologram, remove unused IAMDuration encoder ([#591](https://github.com/dbt-labs/dbt-redshift/issues/591)) | ||
- changes expected value types to AnyInteger to take into account changes in core ([#597](https://github.com/dbt-labs/dbt-redshift/issues/597)) | ||
|
||
### Under the Hood | ||
|
||
- Restructure macro files to be more granular; organize macros by relation and type (create, drop, etc.) ([#590](https://github.com/dbt-labs/dbt-redshift/issues/590)) | ||
- allow for bool/str input to backup/autorefresh when configuring materialized views ([#606](https://github.com/dbt-labs/dbt-redshift/issues/606)) | ||
|
||
### Dependencies | ||
|
||
- Bump mypy from 1.5.0 to 1.5.1 ([#585](https://github.com/dbt-labs/dbt-redshift/pull/585)) | ||
- Update tox requirement from ~=4.9 to ~=4.10 ([#588](https://github.com/dbt-labs/dbt-redshift/pull/588)) | ||
- Update tox requirement from ~=4.10 to ~=4.11 ([#594](https://github.com/dbt-labs/dbt-redshift/pull/594)) | ||
- Update pre-commit requirement from ~=3.3 to ~=3.4 ([#596](https://github.com/dbt-labs/dbt-redshift/pull/596)) | ||
- Update black requirement from ~=23.7 to ~=23.9 ([#600](https://github.com/dbt-labs/dbt-redshift/pull/600)) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: "Dependencies" | ||
body: "Update tox requirement from ~=4.10 to ~=4.11" | ||
time: 2023-09-01T23:09:19.00000Z | ||
custom: | ||
Author: dependabot[bot] | ||
PR: 594 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: "Dependencies" | ||
body: "Update pre-commit requirement from ~=3.3 to ~=3.4" | ||
time: 2023-09-04T19:33:07.00000Z | ||
custom: | ||
Author: dependabot[bot] | ||
PR: 596 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: "Dependencies" | ||
body: "Update black requirement from ~=23.7 to ~=23.9" | ||
time: 2023-09-12T00:23:53.00000Z | ||
custom: | ||
Author: dependabot[bot] | ||
PR: 600 |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: changes expected value types to AnyInteger to take into account changes in core | ||
time: 2023-09-08T11:30:19.77143-05:00 | ||
custom: | ||
Author: McKnight-42 | ||
Issue: "597" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: use get_replace_sql in redshift__get_alter_materialized_view_as_sql, avoid renaming materialized views with custom table.sql and view.sql | ||
time: 2023-09-12T13:33:27.451042-07:00 | ||
custom: | ||
Author: colin-rogers-dbt | ||
Issue: "606" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Under the Hood | ||
body: allow for bool/str input to backup/autorefresh when configuring materialized | ||
views | ||
time: 2023-09-14T13:55:47.951848-07:00 | ||
custom: | ||
Author: colin-rogers-dbt | ||
Issue: "606" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: "Dependencies" | ||
body: "Update ddtrace requirement from ~=1.18 to ~=1.19" | ||
time: 2023-09-18T19:08:33.00000Z | ||
custom: | ||
Author: dependabot[bot] | ||
PR: 610 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: avoid nested loop in query planner execution of redshift__get_relations | ||
time: 2023-09-23T09:11:55.2152725-04:00 | ||
custom: | ||
Author: slin30 | ||
Issue: "609" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Add tests for inlined limit + sql_header in dbt show query | ||
time: 2023-09-25T15:01:32.025325+01:00 | ||
custom: | ||
Author: michelleark | ||
Issue: "616" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# **what?** | ||
# Cleanup branches left over from automation and testing. Also cleanup | ||
# draft releases from release testing. | ||
|
||
# **why?** | ||
# The automations are leaving behind branches and releases that clutter | ||
# the repository. Sometimes we need them to debug processes so we don't | ||
# want them immediately deleted. Running on Saturday to avoid running | ||
# at the same time as an actual release to prevent breaking a release | ||
# mid-release. | ||
|
||
# **when?** | ||
# Mainly on a schedule of 12:00 Saturday. | ||
# Manual trigger can also run on demand | ||
|
||
name: Repository Cleanup | ||
|
||
on: | ||
schedule: | ||
- cron: '0 12 * * SAT' # At 12:00 on Saturday - details in `why` above | ||
|
||
workflow_dispatch: # for manual triggering | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
cleanup-repo: | ||
uses: dbt-labs/actions/.github/workflows/repository-cleanup.yml@main | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = "1.7.0b1" | ||
version = "1.7.0b2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from typing import Union | ||
|
||
|
||
def evaluate_bool_str(value: str) -> bool: | ||
value = value.strip().lower() | ||
if value == "true": | ||
return True | ||
elif value == "false": | ||
return False | ||
else: | ||
raise ValueError(f"Invalid boolean string value: {value}") | ||
|
||
|
||
def evaluate_bool(value: Union[str, bool]) -> bool: | ||
if not value: | ||
return False | ||
if isinstance(value, bool): | ||
return value | ||
elif isinstance(value, str): | ||
return evaluate_bool_str(value) | ||
else: | ||
raise TypeError( | ||
f"Invalid type for boolean evaluation, " | ||
f"expecting boolean or str, recieved: {type(value)}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{% materialization table, adapter='redshift' %} | ||
|
||
{%- set existing_relation = load_cached_relation(this) -%} | ||
{%- set target_relation = this.incorporate(type='table') %} | ||
{%- set intermediate_relation = make_intermediate_relation(target_relation) -%} | ||
-- the intermediate_relation should not already exist in the database; get_relation | ||
-- will return None in that case. Otherwise, we get a relation that we can drop | ||
-- later, before we try to use this name for the current operation | ||
{%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%} | ||
/* | ||
See ../view/view.sql for more information about this relation. | ||
*/ | ||
{%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%} | ||
{%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%} | ||
-- as above, the backup_relation should not already exist | ||
{%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%} | ||
-- grab current tables grants config for comparision later on | ||
{% set grant_config = config.get('grants') %} | ||
|
||
-- drop the temp relations if they exist already in the database | ||
{{ drop_relation_if_exists(preexisting_intermediate_relation) }} | ||
{{ drop_relation_if_exists(preexisting_backup_relation) }} | ||
|
||
{{ run_hooks(pre_hooks, inside_transaction=False) }} | ||
|
||
-- `BEGIN` happens here: | ||
{{ run_hooks(pre_hooks, inside_transaction=True) }} | ||
|
||
-- build model | ||
{% call statement('main') -%} | ||
{{ get_create_table_as_sql(False, intermediate_relation, sql) }} | ||
{%- endcall %} | ||
|
||
-- cleanup | ||
{% if existing_relation is not none %} | ||
/* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped | ||
since the variable was first set. */ | ||
{% set existing_relation = load_cached_relation(existing_relation) %} | ||
{% if existing_relation is not none %} | ||
{% if existing_relation.can_be_renamed %} | ||
{{ adapter.rename_relation(existing_relation, backup_relation) }} | ||
{% else %} | ||
{{ drop_relation_if_exists(existing_relation) }} | ||
{% endif %} | ||
{% endif %} | ||
{% endif %} | ||
|
||
|
||
{{ adapter.rename_relation(intermediate_relation, target_relation) }} | ||
|
||
{% do create_indexes(target_relation) %} | ||
|
||
{{ run_hooks(post_hooks, inside_transaction=True) }} | ||
|
||
{% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %} | ||
{% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %} | ||
|
||
{% do persist_docs(target_relation, model) %} | ||
|
||
-- `COMMIT` happens here | ||
{{ adapter.commit() }} | ||
|
||
-- finally, drop the existing/backup relation after the commit | ||
{{ drop_relation_if_exists(backup_relation) }} | ||
|
||
{{ run_hooks(post_hooks, inside_transaction=False) }} | ||
|
||
{{ return({'relations': [target_relation]}) }} | ||
{% endmaterialization %} |
Oops, something went wrong.