Skip to content

Setting project-wide configuration in dbt_project.yml

The dbt_project.yml file lets you define default configurations for models, seeds, snapshots, and other resources at the project, directory, or subdirectory level, avoiding the need to repeat config() blocks in every model. Configurations set here apply hierarchically based on file path, and can be overridden by more specific configs in individual model files or in yml property files.

1 · Learn the must-know

  • Configurations in dbt_project.yml are nested under resource type keys (e.g., models:, seeds:, snapshots:) followed by the project name and then folder paths matching your file structure.
  • The precedence order from lowest to highest is: dbt_project.yml defaults, then config() in the model/seed/snapshot file itself, then config defined in a schema.yml or properties file, with the most specific/local config always winning.
  • Common configs set here include materialized, schema, tags, enabled, persist_docs, and grants, which can be applied broadly to a folder or narrowed to subfolders.
  • Setting materialized: view or table at the top project level creates a default that individual folders (e.g., staging vs. marts) can override with more specific materializations like incremental or ephemeral.
  • A common gotcha is indentation errors or mismatched folder paths in the yml hierarchy, which silently cause configs not to apply as expected since dbt won't always error loudly.
  • The +config-key: value syntax (with a leading plus sign) is required for resource configs in dbt_project.yml to distinguish them from folder path keys, especially in dbt version 0.17+.

2 · Check your understanding

Check this objectiveFree · always available

Your dbt_project.yml contains: models: my_project: staging: +materialized: view The model file models/staging/stg_orders.sql begins with: {{ config(materialized='table') }} select ... When you run dbt run, how is stg_orders materialized?

Your objective map0 tried · 0 answered correctly · 31 untouched

What you have tried across dbt Analytics Engineering's objectives, not a readiness score.

Developing and optimizing dbt models45.16% of the exam*0 of 14 tried
Managing dbt models governance9.68% of the exam*0 of 3 tried
Debugging data modeling errors16.13% of the exam*0 of 5 tried
Troubleshooting and optimizing dbt pipelines6.45% of the exam*0 of 2 tried
Implementing dbt tests9.68% of the exam*0 of 3 tried
Implementing and maintaining external dependencies6.45% of the exam*0 of 2 tried
Leveraging the dbt state6.45% of the exam*0 of 2 tried

* Our estimate. dbt Labs publishes no section weights.

3 · Keep going