Giter Club home page Giter Club logo

Comments (2)

graciegoheen avatar graciegoheen commented on June 10, 2024

This would create some known :( funky behavior:

  • dbt retry (and only one version of the tests had failed, all would be re-tried)
  • if you fail on any version, we'd block on all versions

Are we ok with that?

Alt.

  • unit test only applies to a single version
  • if you don't supply a version, applies to latest
  • otherwise you must supply an explict version
  • not as DRY
  • not automatic to catch breaking changes to unit testing logic when creating a new version

from dbt-core.

graciegoheen avatar graciegoheen commented on June 10, 2024

After discussing internally, we've decided we are not ok with this funky behavior.

We are going to try again with making one node per unit test run (instead of bundling them together). This is consistent with how we treat data tests that are configured on a model with multiple versions.

Example: a uniqueness test with a versioned model.

models:
  - name: my_model
    columns:
      - name: id
        tests:
          - unique
    versions:    
      - v: 1
      - v: 2

Command:

dbt list -s my_model

Output:

20:28:35  Running with dbt=1.7.4
20:28:36  Registered adapter: duckdb=1.7.0
20:28:36  Found 3 models, 1 snapshot, 1 analysis, 1 seed, 2 tests, 1 source, 0 exposures, 1 metric, 391 macros, 0 groups, 1 semantic model
my_project.my_model.v1
my_project.my_model.v2
my_project.unique_my_model_v1_id
my_project.unique_my_model_v2_id

Note where it says β€œ2 tests” and that it shows those 2 tests.

If we are unable to overcome the partial parsing issues with the above solution, we will have a known restriction that you can only apply 1 unit test per model version. We will then not allow folks to specify multiple versions of a model that unit test to apply to. If no version is specified, we will use the latest version.

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.