Setting severity on data_tests

This page shows how to use severity for data tests, even though it keeps referencing the old “tests” within the document: Configuring test `severity` | dbt Developer Hub

But when I do it, I get an error


      - name: unit_badi_id
        data_tests:
          - not_null
            config:
              severity: warn
          - unique
            config:
              severity: warn
  Syntax error near line 32
    ------------------------------
    29 |       - name: unit_badi_id
    30 |         data_tests:
    31 |           - not_null
    32 |             config:
    33 |               severity: warn
    34 |           - unique
    35 |             config:

    Raw Error:
    ------------------------------
    mapping values are not allowed in this context
      in "<unicode string>", line 32, column 19

And on this page I can’t find any mention of severity: Add data tests to your DAG | dbt Developer Hub

What should be the syntax?

Maybe it is the identation and ‘:’ symbol, try

      - name: unit_badi_id
        data_tests:
          - not_null:
              config:
                severity: warn
          - unique:
              config:
                severity: warn

Nope, even though I thought this would be weird indentation, I checked it and get the same error:

    Syntax error near line 32
    ------------------------------
    29 |       - name: unit_badi_id
    30 |         data_tests:
    31 |           - not_null
    32 |               config:
    33 |                 severity: warn
    34 |           - unique
    35 |               config:
    
    Raw Error:
    ------------------------------
    mapping values are not allowed in this context
      in "<unicode string>", line 11, column 21

Include the : symbol also

      - not_null:

Ahh, okay that’ll do it. Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.