Comments (2)
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.
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)
- Add `--host` flag to `dbt docs serve`, defaulting to '127.0.0.1' HOT 2
- [Bug] `dbt -v` doesn't know that adapters are decoupled from core HOT 1
- Warn if `updated_at` field for snapshot is not same datatype (or timezone) as what's returned in `snapshot_get_time()` HOT 2
- Improve capturing the history of records in a deleted state HOT 2
- New snapshot config to validate uniqueness before merge
- Support specifying types for recording
- [Bug] the run_query macro causes unit tests to fail with a SQL Compilation error HOT 1
- [Feature] No more jinja block for snapshots - new snapshot design
- [Feature] Emit a more specific error when there are duplicate columns in a model with an enforced contract HOT 1
- Replace jsonschema with fastjsonschema for validation
- [Security] CVE-2019-8341 advice please HOT 5
- [Feature] Conservative with changing public Python API's HOT 1
- [Feature] Unit tests should support Gherkin table style inputs
- [Bug] Error running unit tests that use the `dbt_utils.star` macro HOT 2
- Create "happy path" project fixture and use it for `tests/functional/list/test_list.py`
- Use, and extend as necessary, happy path fixture for `tests/functional/show/test_show.py`
- [Bug] dbt test --select "source:*" runs model tests if they reference a source HOT 3
- [Feature] Add a head command to see the first rows of a table HOT 4
- [Feature] Add `--fail-if-nothing-selected` (or something similar) HOT 6
- [Bug] Not able to select unit tests via the `--resource-type` flag HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbt-core.