Giter VIP home page Giter VIP logo

Comments (4)

mkielar avatar mkielar commented on May 20, 2024

Here's the use-case for it:

We use dbt to populate databases of a web-application. There are specific moments where these are ran, and they populate data to initiate some business processes in the application. I plan on having several table-wide tests, to guarantee data consistency, before web-app processes are initiated, but these tests will most definitely not be generic - one, perhaps more dedicated tests per table. Thus, singular data tests.

Now, because the data may be inconsistent (I'm loading it from several source systems which may serve out-of-sync, or corrupted information), I'd like to run dbt test and get a report of failures and warnings to show to the users when the process fails. These messages should be human readable. Names such as dbt_expectations_expect_column_values_to_be_between_users_user_details_age__120__0 are hardly readable for someone who doesn't work with DBT, and definitely not suited to be shown in an otherwise pretty Web UI.

So I thought I could name the tests using the name attribute, and while it works for generic tests in models.yml, I cannot make it work for singular tests in /test folder.

As a workaround:

  • I can, of course, name the file Example assertion with custom name.sql instead of assert_example.sql, and that seems to do what I want, but requires me to have whitespace in filenames (which I'm not too keen of).
  • I also can refactor my dedicated tests into generic ones, and invoke them from models.yml. This has the advantage of having all tests specified in a single place. It's just bending the tool to my needs instead of using it properly...

from dbt-core.

dbeatty10 avatar dbeatty10 commented on May 20, 2024

Thanks for describing your use case and what you ran into @mkielar !

The docs you referenced only applies to the tests property within models, which are generic data tests (rather than including singular data tests as well). So I'm going to re-label this as a feature request.

I buy it that you should be able to customize the name for singular data tests just like they can be customized for generic data tests.

Since we'd be unable to prioritize this ourselves any time soon, I'm going to mark this as "help wanted".

from dbt-core.

onerishabh avatar onerishabh commented on May 20, 2024

Hey @dbeatty10 ,
Is this something I can dip my toe in? Keen to contribute to dbt-core ☺️

from dbt-core.

octo-youcef avatar octo-youcef commented on May 20, 2024

@dbeatty10 @mkielar I'm more than happy to throw my name in the hat for this (with a little guidance). Roughly this requirement has come up at my work so fixing at source seems smarter than whatever terrible ideas I had for tackling this locally.

from dbt-core.

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.