-
Notifications
You must be signed in to change notification settings - Fork 59
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
Fix parsing of database results for materialized view autorefresh #643
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-redshift contributing guide. |
1 similar comment
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-redshift contributing guide. |
@@ -163,19 +163,6 @@ def test_change_is_applied_via_alter_str_true(self, project, my_materialized_vie | |||
assert_message_in_logs(f"Applying ALTER to: {my_materialized_view}", logs) | |||
assert_message_in_logs(f"Applying REPLACE to: {my_materialized_view}", logs, False) | |||
|
|||
def test_change_is_applied_via_alter_str_false(self, project, my_materialized_view): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string version of this is already tested with the test above. Also, this does not represent a change, and just the fact that "False"
is treated the same as False
. This is covered in a unit test.
"query": cls._parse_query(query.get("definition")), | ||
} | ||
|
||
autorefresh_value = materialized_view.get("autorefresh") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redshift returns the value as a single character: 't'
or 'f'
. Sometimes agate
picks this up and converts and sometimes it does not.
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.6.latest 1.6.latest
# Navigate to the new working tree
cd .worktrees/backport-1.6.latest
# Create a new branch
git switch --create backport-643-to-1.6.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b4176b95ee976b6c503a49904f754c8953730480
# Push it to GitHub
git push --set-upstream origin backport-643-to-1.6.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.6.latest Then, create a pull request where the |
* map t/f to bool for database results * remove unnecessary test that did not properly test its hypothesis * changelog (cherry picked from commit b4176b9)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.6.latest 1.6.latest
# Navigate to the new working tree
cd .worktrees/backport-1.6.latest
# Create a new branch
git switch --create backport-643-to-1.6.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b4176b95ee976b6c503a49904f754c8953730480
# Push it to GitHub
git push --set-upstream origin backport-643-to-1.6.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.6.latest Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.6.latest 1.6.latest
# Navigate to the new working tree
cd .worktrees/backport-1.6.latest
# Create a new branch
git switch --create backport-643-to-1.6.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b4176b95ee976b6c503a49904f754c8953730480
# Push it to GitHub
git push --set-upstream origin backport-643-to-1.6.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.6.latest Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.6.latest 1.6.latest
# Navigate to the new working tree
cd .worktrees/backport-1.6.latest
# Create a new branch
git switch --create backport-643-to-1.6.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b4176b95ee976b6c503a49904f754c8953730480
# Push it to GitHub
git push --set-upstream origin backport-643-to-1.6.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.6.latest Then, create a pull request where the |
* map t/f to bool for database results * remove unnecessary test that did not properly test its hypothesis * changelog (cherry picked from commit b4176b9)
…d view autorefresh (#645) * Fix parsing of database results for materialized view autorefresh (#643) * map t/f to bool for database results * remove unnecessary test that did not properly test its hypothesis * changelog (cherry picked from commit b4176b9) * remove test that did not exist in 1.6; missed during merge conflict resolution
Problem
The results from the database for auto refresh on a materialized view returned unhandled values. This caused an incorrect flow through the logic in the materialization.
Solution
Map the values from the query to their appropriate boolean values.
Checklist