Aaryan Ohekar
Aaryan Ohekar

Reputation: 31

Using config block in dbt_project.yml

I am trying to use dbt_project.yml to convert selective warnings to errors.In my use case, I would want to convert NoNodesForSelectionCriteria and NothingToDo warning to error. For this, I am trying to use the code:

#dbt_project.yml

config:
   warn_error : true

But I am getting the following runtime error:

dbt.exceptions.ProjectContractError : Runtime Error
  at path [] : Additional properties are not allowed ('config' was unexpected)

dbt_core_version : 1.4.8 python_version : 3.10.11

Upvotes: 0

Views: 43

Answers (1)

codug
codug

Reputation: 13

You cannot use the config property in dbt_project.yml. You should use flags instead:

Use flag warn_error

To transform all warnings to errors:

flags:
  warn_error: true

Use flag warn_error_options

To transform some flags to errors:

flags:
  warn_error_options:
    error: # Previously called "include"
      - NoNodesForSelectionCriteria
      - NothingToDo
    warn: # Previously called "exclude"
    silence: # To silence or ignore warnings

Sources:

Upvotes: 0

Related Questions