testing-a-datavault4dbt-project

Solid

Adds Data Vault 2 technical tests to a datavault4dbt project — hashkey uniqueness and not-null, link-to-hub referential integrity, and satellite key+load-date uniqueness — as dbt soft-constraint tests in YAML. Use when adding or reviewing tests for hubs, links, or satellites, or validating raw vault integrity.

Testing & QA 22 stars 0 forks Updated 2 weeks ago Apache-2.0

Install

View on GitHub

Quality Score: 85/100

Stars 20%
45
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Testing a datavault4dbt project Turn the Primary-Key and Foreign-Key assumptions of Data Vault 2 into dbt tests. In DV2 these are **soft constraints** — implemented as dbt tests that warn (and let you investigate) rather than hard database constraints that would silently drop "bad and ugly" raw data you still want to capture. **Default to soft constraints (dbt tests).** Only use hard database constraints if you accept the risk of losing non-conforming raw data and have an Error Mart to catch it. ## Where these tests live Add `data_tests` in the model's YAML file (colocated with the `.sql`). Generic tests `unique` and `not_null` are built in; `relationships` covers FK integrity. For multi-column uniqueness (satellites) use `dbt_utils.unique_combination_of_columns` (add the `dbt_utils` package) or an equivalent. ## The technical test matrix | Entity | Column(s) | Test | |--------|-----------|------| | Hub | hashkey | `not_null`, `unique` | | Link | link hashkey | `not_null`, `unique` | | Link | each foreign hashkey | `relationships` to its connected hub's hashkey | | Satellite v0 | hashkey + load date | unique combination of columns | | Satellite v0 | hashkey | `relationships` to parent hub/link | | Non-historized link | link hashkey | `not_null`, `unique` | | Non-historized link | each foreign hashkey | `relationships` to connected hubs | | Non-historized satellite v0 | hashkey | `not_null`, `unique`, `relationships` to parent NH-link | | Multi-active satellite v0 | ha...

Details

Author
ScalefreeCOM
Repository
ScalefreeCOM/datavault4dbt-agent-skills
Created
2 months ago
Last Updated
2 weeks ago
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category