Skip to content

Commit

Permalink
Merge branch '1.6.latest' into backport-601-to-1.6.latest
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-rogers-dbt authored Oct 26, 2023
2 parents f31b40b + a17a453 commit 1dd8231
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20231025-203732.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Fix parsing of database results for materialized view auto refresh
time: 2023-10-25T20:37:32.191259-04:00
custom:
Author: mikealfare
Issue: "643"
6 changes: 5 additions & 1 deletion dbt/adapters/redshift/relation_configs/materialized_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,14 @@ def parse_relation_results(cls, relation_results: RelationResults) -> dict:
"mv_name": materialized_view.get("table"),
"schema_name": materialized_view.get("schema"),
"database_name": materialized_view.get("database"),
"autorefresh": materialized_view.get("autorefresh"),
"query": cls._parse_query(query.get("definition")),
}

autorefresh_value = materialized_view.get("autorefresh")
if autorefresh_value is not None:
bool_filter = {"t": True, "f": False}
config_dict["autorefresh"] = bool_filter.get(autorefresh_value, autorefresh_value)

# the default for materialized views differs from the default for diststyle in general
# only set it if we got a value
if materialized_view.get("diststyle"):
Expand Down

0 comments on commit 1dd8231

Please sign in to comment.