Is there an easy way to write a test for a column being positive in dbt?
accepted_values
doesn't seem to work for continuous vatiables.
I know you can write queries in ./tests
but it looks like an overkill for such a simple thing.
You could use dbt_utils.expression_is_true
version: 2
models:
- name: model_name
tests:
- dbt_utils.expression_is_true:
expression: "col_a > 0"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With