-
Notifications
You must be signed in to change notification settings - Fork 934
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
Nfiann-prehook-emptyflag #6228
Open
nataliefiann
wants to merge
23
commits into
current
Choose a base branch
from
nfiann-prehook-emptyflag
base: current
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Nfiann-prehook-emptyflag #6228
Changes from 18 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3f7349e
Created snippet file
nataliefiann f01188f
created snippet
nataliefiann dd354e0
Updated snippets file, reworded build file, and added reusable snipper
nataliefiann c3e578d
Update website/snippets/_render-method.md
nataliefiann 222d8aa
Update website/snippets/_render-method.md
nataliefiann 290defa
Update website/snippets/_render-method.md
nataliefiann b7f20a0
Update website/snippets/_render-method.md
nataliefiann 98cc86c
Update website/snippets/_render-method.md
nataliefiann 7dbe42a
Update website/snippets/_render-method.md
nataliefiann 7492b0e
Update website/snippets/_render-method.md
nataliefiann 3610480
Merge branch 'current' into nfiann-prehook-emptyflag
nataliefiann 37b9c02
Updated render method
nataliefiann f4b5183
Merge branch 'nfiann-prehook-emptyflag' of https://github.com/dbt-lab…
nataliefiann cb0e4b9
Update website/snippets/_render-method.md
nataliefiann c1d859c
Update website/snippets/_render-method.md
nataliefiann 6b26b37
Update website/snippets/_render-method.md
nataliefiann 9d746ca
Update website/snippets/_render-method.md
nataliefiann e1a218a
Update website/snippets/_render-method.md
nataliefiann b6f6a1b
Update website/snippets/_render-method.md
nataliefiann 15dd0f2
Update website/snippets/_render-method.md
nataliefiann 676f4c7
Update website/snippets/_render-method.md
nataliefiann d349512
Merge branch 'current' into nfiann-prehook-emptyflag
mirnawong1 55666c1
Merge branch 'current' into nfiann-prehook-emptyflag
mirnawong1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,20 @@ | ||
#### The render method | ||
|
||
The `.render()` method is generally used to resolve or evaluate Jinja expressions (such as `{{ source(...) }}`) during runtime. When a pre-hook or post-hook contains a dynamic reference, such as a table or column, dbt might not automatically resolve the reference correctly, particularly when certain flags (such as `--empty`) are applied. | ||
|
||
When using the `--empty flag`, dbt may skip processing `ref()` or `source()` for optimization. To avoid compilation errors and to explicitly tell dbt to process a specific relation (`ref()` or `source()`), use the `.render()` method in your model file. For example: | ||
|
||
|
||
<File name='models.sql'> | ||
|
||
```Jinja | ||
{{ config( | ||
pre_hook = [ | ||
"alter external table {{ source('sys', 'customers').render() }} refresh" | ||
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
select * from {{ source("sys", "customers") }} | ||
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
select * from cus | ||
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
</File> |
Oops, something went wrong.
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.
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.
sugg removing the first paragraph to simplify the explanation since the 2nd paragraph already covers the key point about using .render() with the --empty flag