dbt-testing

Implement dbt data quality tests with dbt_constraints for database-level constraints.

34|13|Updated Feb 1, 2022
One-click install
npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbt-testing
Source: https://github.com/sfc-gh-dflippo/snowflake-dbt-demo/tree/main/.claude/skills/dbt-testing
Command: npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates data quality issues by implementing comprehensive testing strategies that enforce constraints at the database level, not just during dbt runs.

Core Features & Use Cases

  • Database-Level Constraints: Use dbt_constraints package for 24/7 enforcement of primary keys, foreign keys, and unique constraints.
  • Layered Testing Approach: Implement appropriate tests for bronze (staging), silver (intermediate), and gold (marts) layers.
  • Use Case: When building a customer analytics pipeline, use this Skill to ensure all customer IDs are unique, orders reference valid customers, and business metrics follow expected ranges.

Quick Start

Use the dbt-testing skill to create primary key constraints for my customer dimension table using dbt_constraints.

Frequently Asked Questions about dbt-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce data quality constraints at the database level in dbt?

Database-level constraints enforce data quality 24/7 using the dbt_constraints package to define primary keys, foreign keys, and unique constraints in your dbt project. This approach maintains data integrity across bronze, silver, and gold layers independent of dbt run frequency.

What's the best way to test data across different dbt layer maturity levels?

Implement layered testing by applying different test strategies for each stage: staging tests for bronze data quality, intermediate validation for silver transformations, and business logic verification for gold marts. Use generic reusable tests and singular one-off tests appropriate to each layer's purpose.

Can I use dbt_constraints with Snowflake to validate foreign key relationships?

Yes, dbt_constraints integrates with Snowflake to enforce foreign key relationships alongside primary keys and unique constraints. This provides real-time validation that order IDs reference valid customers and other referential integrity requirements across your data warehouse.

How do I configure test severity and handle test failures in dbt?

Configure test severity levels to determine failure impact and specify where failures are stored for monitoring. This allows critical data quality issues to block downstream processes while non-critical failures log for review, maintaining workflow flexibility.

Do I need dbt_utils to implement comprehensive data quality testing?

dbt_utils complements dbt_constraints by providing utility functions for test creation and management. While not required for basic testing, package management for both tools enables more maintainable, reusable test definitions across your dbt project.