calogica / dbt-expectations

Port(ish) of Great Expectations to dbt test macros
https://calogica.github.io/dbt-expectations/
Apache License 2.0
989 stars 120 forks source link

[BUG] I cant add severity: WARN #264

Closed YevgenyLevi closed 1 year ago

YevgenyLevi commented 1 year ago

Is this a new bug in dbt-expectations?

Current Behavior

My code:

tests:

Relevant log output

test definition dictionary must have exactly one key, got [('dbt_expectations.expect_column_values_to_be_between', {'min_value': 300, 'max_value': 850}), ('severity', 'WARN')] instead (2 keys)

Environment

TEST

- OS:
- Python:
- dbt:
- dbt-expectations:

Which database adapter are you using with dbt?

Postgres

Note: dbt-expectations currently does not support database adapters other than the ones listed below.

Additional Context

clausherther commented 1 year ago

Hi, this is actually not an issue with severity, you need to indent all keys:

- dbt_expectations.expect_column_values_to_be_between:
    min_value: 300
    max_value: 850
    severity: WARN

See this example.

YevgenyLevi commented 1 year ago

Yes, actually now I see that it works, I don't know what I changed in my indentation, looks the same :) thanks!