admin管理员组

文章数量:1318021

I wanted to use the warn_error_option or warn_error in dbt to selectively mark some warnings as errors.

Following the official documentation of dbt (), we can use something like this :

#dbt_project.yaml
name: "my_dbt_project"
flags:
  warn_error_options:
    error: 
       - NoNodesForSelectionCriteria 
    warn:
    silence:

But when I try to run a model named test_model.sql that does not exist, instead of throwing error, it still gives me the following in the logs:

The selection criterion 'test_model' does not match any nodes
Nothing to do.Try checking your model configs and model specification args.

Can anyone suggest changes needed in the code ?Is warn_error or warn_error_option flag compatible with dbt core v1.4.8

I wanted to use the warn_error_option or warn_error in dbt to selectively mark some warnings as errors.

Following the official documentation of dbt (https://docs.getdbt/reference/global-configs/warnings), we can use something like this :

#dbt_project.yaml
name: "my_dbt_project"
flags:
  warn_error_options:
    error: 
       - NoNodesForSelectionCriteria 
    warn:
    silence:

But when I try to run a model named test_model.sql that does not exist, instead of throwing error, it still gives me the following in the logs:

The selection criterion 'test_model' does not match any nodes
Nothing to do.Try checking your model configs and model specification args.

Can anyone suggest changes needed in the code ?Is warn_error or warn_error_option flag compatible with dbt core v1.4.8

Share Improve this question edited Jan 22 at 17:57 desertnaut 60.4k32 gold badges153 silver badges181 bronze badges asked Jan 22 at 16:24 Aaryan OhekarAaryan Ohekar 313 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

In dbt 1.4 the flags warn_error and warn_error_options are defined in profiles.yml:

config:
  warn_error: true
  warn_error_options: 
    include: all
    exclude:
      - NoNodesForSelectionCriteria

Reference: https://github/dbt-labs/docs.getdbt/blob/1a9ca4d4594fbcf683d260afc83927262b5582a1/website/docs/reference/global-configs.md#warnings-as-errors

Note that the version 1.4 is no longer supported. See https://docs.getdbt/docs/dbt-versions/core

本文标签: Using warnerroroptions or warnerror in dbtcore 148Stack Overflow