dbt_project.yml Context
▶Changelog
The following context variables and methods are available when configuring
resources in the dbt_project.yml
file. This applies to the models:
, seeds:
,
and snapshots:
keys in the dbt_project.yml
file.
Available context variables:
- target
- env_var
- vars (Note: only variables defined with
--vars
are available) - builtins
- dbt_version
Example configuration
dbt_project.yml
name: my_project
version: 1.0.0
# Configure the models in models/facts/ to be materialized as views
# in development and tables in production/CI contexts
models:
my_project:
facts:
+materialized: "{{ 'view' if target.name == 'dev' else 'table' }}"
0