(#1717) fix for re-rendering in statement calls #1719
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1717
Fixes #1108
This PR removes the call to
render()
in statement blocks. For most applications of dbt, this shouldn't change anything at all. I had to amend therun_hooks
macro to render hooks, as they previously relied on statement blocks to be rendered. While I was in there, I added a check to skip queries for empty hooks, which should fix #1108.We should think hard about if there are any other built-in parts of the dbt codebase which rely on statements re-rendering queries - I don't believe there are, but if they do exist, they're probably not explicitly tested. We should also add a note to the release notes / migration guide describing this change in behavior, as it could be very breaking for some dbt projects out there.