-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When parsing `DbtModel` using `LoadMode.CUSTOM`, if the SQL file contains vars, the `upstream models` models fail (vars were not rendered as expected). This is because when a model is added to `upstream_models` only `Const` types are allowed and `Concat` types are skipped. ``` -- sql file SELECT column_1, column_2, FROM {{ ref('stg_users_'~ var('country_code')) }} # ex) `stg_users_us` is added to upstream_models ``` The fix uses expects users to set the `vars ` argument within `operator_args`, when adding `upstream_models`. If a variable exists, but it is not defined in `vars`, it raises KeyError and skips as before. If the correct value exists for `vars` it the value is added up to `upstream_model`. Closes #495
- Loading branch information
Showing
4 changed files
with
60 additions
and
17 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
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