Coder Social home page Coder Social logo

Comments (6)

seanpwlms avatar seanpwlms commented on September 4, 2024 1

@clausherther Thank you! Of course the answer is to read the docs. Adding error_if converts the severity to a "warn", which you can make pass by adding a warn_if setting.

from dbt-expectations.

rfortmann-ewolff avatar rfortmann-ewolff commented on September 4, 2024 1

I could solve my own problem.

          - name: name_tracker
            tests:
              - dbt_expectations.expect_column_values_to_be_in_set:
                  value_set: ["ssc", "sp2", "cf", "ssc1"]
                  severity: warn

I hope it might help others.

from dbt-expectations.

clausherther avatar clausherther commented on September 4, 2024 1

@rfortmann-ewolff glad you solved it! I think the + syntax in dbt is for project config settings only, but not sure.

from dbt-expectations.

seanpwlms avatar seanpwlms commented on September 4, 2024

Apologies if this is addressed elsewhere, but this looks like the closest issue. For the expect_grouped_row_values_to_have_recent_data test, I have one group that will not have recent data for valid reasons. Currently the test fails, saying Got 1 result, configured to fail if != 0. It would be great if I could specify fail if result > n.

from dbt-expectations.

clausherther avatar clausherther commented on September 4, 2024

Hi @seanpwlms ! I think this might actually be supported in the new dbt test configs:
https://docs.getdbt.com/reference/test-configs
I haven't played around with this, but I think the relevant config is error_if https://docs.getdbt.com/reference/resource-configs/severity
Would love to hear if this is works for you and how you ended up using it!

from dbt-expectations.

rfortmann-ewolff avatar rfortmann-ewolff commented on September 4, 2024

I tried using the severity and the warn_if arguments but dbt encounter an error:

          - name: name_tracker
            tests:
              - dbt_expectations.expect_column_values_to_be_in_set:
                  value_set: ["ssc", "sp2", "cf", "ssc1"]
                  +severity: warn
Running with dbt=0.20.0
Encountered an error:
Compilation Error
  Invalid test config given in models/snowplow/sources_in_snowplow.yml:
        test definition dictionary must have exactly one key, got [('not_null', None), ('+severity', 'warn')] instead (2 keys)

and

          - name: name_tracker
            tests:
              - dbt_expectations.expect_column_values_to_be_in_set:
                  value_set: ["ssc", "sp2", "cf", "ssc1"]
                  +warn_if: "!=0"
Running with dbt=0.20.0
Encountered an error:
Compilation Error in test dbt_expectations_source_expect_column_values_to_be_in_set_snowplow_events__0__name_tracker__ssc__sp2__cf__ssc1 (models/snowplow/sources_in_snowplow.yml)
  macro 'dbt_macro__test_expect_column_values_to_be_in_set' takes no keyword argument '+warn_if'

Any idea what the problem could be ?

from dbt-expectations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.