DBT switch node path warnings to errors
Asked Answered
G

1

1

is there a way to make these warnings in DBT errors?

[WARNING]: Did not find matching node for patch with name 'my_model' in the 'models' section of file 'models/path/to/model.yml'

We check errors at PR time, and I'd like to switch those to errors, so they can block merges into our repo.

We're trying to enforce more strictness in the model, so that we don't leave any unused path dangling in the model definition.

Glauce answered 9/8, 2022 at 13:10 Comment(0)
K
2

You can use the --warn-error option to raise errors on any warnings. From dbt --help:

If dbt would normally warn, instead raise an exception. Examples include --models that selects nothing, deprecations, configurations with no associated models, invalid test configurations, and missing sources/refs in tests.

So to use dbt build with this option, you would run:

$ dbt --warn-error build
Kerguelen answered 9/8, 2022 at 17:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.