You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This branch primarily addresses code cleanup/refactoring. In addition, it seemed like a good time to add arbitrary model nesting support. Everything can be arbitrarily deeply nested. This includes .csv files, model .sql files, schema.yml files, and analysis files!
New dbt_project.yml model configurations
Suppose the root of your models repository looks like this:
You can structure your models config in dbt_project.yml to selectively configure models at any depth you want. You must specify the full path to a model in the config for its configuration to take affect. That is, if your file is located at models/saas_service/summary/domain_counts.sql, your config should look like:
Of course, if you just want to enable all models in Your Project Name, you can write:
models:
'Your Project Name':
enabled: true
This works at any level of the config, and the most restrictive config that can apply to a model is used. Each level of the config "inherits" its parents config and can overwrite some or all of it.
A full example:
name: 'My Project Name'version: '1.0'
...
# default parameters that apply to _all_ models (unless overridden below)model-defaults:
enabled: true # enable all models by defaultmaterialized: false # If true, create tables. If false, create viewsmodels:
'My Project Name': # this is the name of your dbt project (listed above)enabled: true # by default, enable models in this repository (including deps)saas_service:
enabled: false # disable 'My Project Name'.saas_service.*materialized: trueemails:
enabled: true # specifically enable 'My Project Name'.saas_service.emails'Analyst_Collective': # this is a dependency listed belowenabled: false # by default, disable all 'Analyst_Collective' modelsemails:
enabled: true # only turn on 'email' and 'pardot' modelspardot:
enabled: truerepositories:
- "git@github.com:analyst-collective/analytics.git"# name = 'Analyst_Collective'
The text was updated successfully, but these errors were encountered:
#50
Summmary
This branch primarily addresses code cleanup/refactoring. In addition, it seemed like a good time to add arbitrary model nesting support. Everything can be arbitrarily deeply nested. This includes
.csv
files, model.sql
files,schema.yml
files, andanalysis
files!New
dbt_project.yml
model configurationsSuppose the root of your models repository looks like this:
You can structure your
models
config indbt_project.yml
to selectively configure models at any depth you want. You must specify the full path to a model in the config for its configuration to take affect. That is, if your file is located atmodels/saas_service/summary/domain_counts.sql
, your config should look like:Of course, if you just want to enable all models in
Your Project Name
, you can write:This works at any level of the config, and the most restrictive config that can apply to a model is used. Each level of the config "inherits" its parents config and can overwrite some or all of it.
A full example:
The text was updated successfully, but these errors were encountered: