testing-dbt-models

Solid

Adds schema tests and data quality validation to dbt models. Use when working with dbt tests for: (1) Adding or modifying tests in schema.yml files (2) Task mentions "test", "validate", "data quality", "unique", "not_null", or "accepted_values" (3) Ensuring data integrity - primary keys, foreign keys, relationships (4) Debugging test failures or understanding why dbt test failed Matches existing project test patterns and YAML style before adding new tests.

Testing & QA 122 stars 10 forks Updated 1 months ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
70
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# dbt Testing **Every model deserves at least one test. Primary keys need unique + not_null.** ## Workflow ### 1. Study Existing Test Patterns **CRITICAL: Match the project's existing testing style before adding new tests.** ```bash # Find all schema.yml files with tests find . -name "schema.yml" -exec grep -l "tests:" {} \; # Read existing tests to learn patterns cat models/staging/schema.yml | head -100 cat models/marts/schema.yml | head -100 # Check for custom tests or dbt packages ls tests/ cat packages.yml 2>/dev/null ``` **Extract from existing tests:** - YAML formatting style (indentation, spacing) - Test coverage depth (all columns vs key columns only) - Use of custom tests (dbt_utils, dbt_expectations, custom macros) - Description style (brief vs detailed) - Severity levels used (warn vs error) ### 2. Read Model SQL ```bash cat models/<path>/<model_name>.sql ``` Identify: primary keys, foreign keys, categorical columns, date columns, business-critical fields. ### 3. Check Existing Tests for This Model ```bash cat models/<path>/schema.yml | grep -A 50 "<model_name>" # or find . -name "schema.yml" -exec grep -l "<model_name>" {} \; ``` ### 4. Identify Testable Columns | Column Type | Recommended Tests | |-------------|-------------------| | Primary key | `unique`, `not_null` | | Foreign key | `not_null`, `relationships` | | Categorical | `accepted_values` (ask user for valid values) | | Required field | `not_null` | | Date/timestamp | `not_null` | | Bool...

Details

Author
AltimateAI
Repository
AltimateAI/data-engineering-skills
Created
7 months ago
Last Updated
1 months ago
Language
N/A
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Testing & QA Listed

testing-dbt-projects

Add data quality tests to a dbt project — generic tests (unique, not_null, accepted_values, relationships), singular tests, unit tests, dbt-utils and dbt-expectations packages, and source freshness. Use when adding tests to dbt models, catching data quality regressions, validating assumptions, or setting up source freshness checks.

17 Updated 1 weeks ago
Unknown-333
Data & Documents Listed

data-quality

Use when adding or reviewing data quality tests for dbt models in warehouse-backed analytics projects. Covers dbt generic tests, singular tests (assert_*.sql), accepted-values macros, dbt_utils patterns, cross-system consistency tests, and warehouse-oriented validation. Use when writing data tests, creating assert_*.sql files, testing business logic, or validating referential integrity.

6 Updated 1 months ago
yeaight7
Data & Documents Listed

data-quality

Write systematic data quality checks — validation rules, Great Expectations suites, dbt tests, anomaly detection, null/type/range/referential integrity assertions, and monitoring patterns for production pipelines. Use this skill whenever the user is dealing with bad data in a pipeline, setting up validation before or after a load step, adding tests to dbt models, writing Great Expectations expectations, or trying to detect when upstream data has changed shape. Also trigger when stakeholders keep finding incorrect numbers, when a pipeline silently loads garbage, or when the user asks "how do I make sure my data is correct". Prevention is cheaper than debugging.

1 Updated 1 months ago
Methasit-Pun