Skip to content

Changing how a dbt run behaves with command flags

dbt behavior flags let you control how dbt parses, compiles, and executes projects without changing SQL logic, which is critical when debugging errors that appear only after a dbt version upgrade. Flags are set in the flags section of dbt_project.yml (or via CLI/env vars) and often govern legacy vs. new behavior for things like node coloring, quoting, or materialization logic. Understanding flags helps you distinguish 'real' modeling bugs from version-driven behavior changes.

1 · Learn the must-know

  • Behavior flags are typically defined under a flags: key in dbt_project.yml and can also be overridden via CLI flags or environment variables for a single run.
  • When dbt Labs changes default behavior in a new release, they often ship it behind a flag defaulting to the legacy value first, then flip the default in a later minor/major version—so silent breakage after an upgrade is a common exam scenario.
  • Running dbt --help or checking release notes/CHANGELOG is the standard way to discover which flags exist and their current default in your installed version.
  • Some flags affect parsing/compilation (e.g., strict validation of properties or configs), so an error that only appears after upgrading dbt Core is a strong clue to check for a related behavior flag rather than assuming the SQL/model is broken.
  • Setting a flag incorrectly (wrong scope, wrong project file, or typoed key) will usually cause dbt to silently ignore it and fall back to the default, which is a common debugging trap.
  • Flags are project-wide by default but some can be scoped per-resource or overridden at the command line for testing before committing to a project-wide change.

2 · Check your understanding

Check this objectiveFree · always available

You edit a custom Jinja macro that changes how a column alias is generated, then run dbt run. The compiled SQL in target/compiled still shows the old alias, and the model builds with the previous (wrong) column name even though the macro file was clearly saved. Which flag should you add to your next invocation to force dbt to reparse the project from scratch instead of reusing its cached manifest?

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