I am creating an importable dbt package in a private GitHub repo which consists of a set of macros. I have a small set of variables defined in the dbt_project.yml
file for this package. These variables are accessed by the package macros using the {{ var('<some_var>') }}
syntax.
After more carefully reading the dbt docs and trying it out, I am now seeing that the variables from the packages’ dbt_project.yml
file are not inherited into the variables of the main project (the macros are resolved by the main project).
Most dbt packages in the packages hub don’t have vars defined in their dbt_project.yml
files, however the dbt-snowplow-web
package does have vars defined in their dbt_project.yml
file that are accessed by internal project macros. For example here. I am wondering how they get this to work? Would I just need to copy over the vars from the package into the main projects dbt_project.yml
file or is there a better way to go about this?
Thanks!