Implement data quality validation with Great Expectations
Data quality frameworks

Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts.
--- name: data-quality-frameworks description: Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts. --- # Data Quality Frameworks Production patterns for implementing data quality with Great Expectations, dbt tests, and data contracts to ensure reliable data pipelines. ## When to Use This Skill - Implementing data quality checks in pipelines - Setting up Great Expectations validation - Building comprehensive dbt test suites - Establishing data contracts between teams - Monitoring data quality metrics - Automating data validation in CI/CD
Overview
Production patterns for implementing data quality with Great Expectations, dbt tests, and data contracts to ensure reliable data pipelines.
Manual install (npx, ZIP)
npx skills add wshobson/agents --skill data-quality-frameworks -g -a claude-codemkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \
| tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/data-engineering/skills/data-quality-frameworksNew-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/14b5971af4d223737bea/data-quality-frameworks.zip" -OutFile "$env:TEMP\data-quality-frameworks.zip"; Expand-Archive "$env:TEMP\data-quality-frameworks.zip" -DestinationPath "$HOME\.claude\skills" -ForceConnects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md4.4 KBreferences/1 file · 11.4 KB
Read the files here
Show the full text139 lines
Data Quality Frameworks
Production patterns for implementing data quality with Great Expectations, dbt tests, and data contracts to ensure reliable data pipelines.
When to Use This Skill
- Implementing data quality checks in pipelines
- Setting up Great Expectations validation
- Building comprehensive dbt test suites
- Establishing data contracts between teams
- Monitoring data quality metrics
- Automating data validation in CI/CD
Core Concepts
1. Data Quality Dimensions
| Dimension | Description | Example Check |
|---|---|---|
| Completeness | No missing values | expect_column_values_to_not_be_null |
| Uniqueness | No duplicates | expect_column_values_to_be_unique |
| Validity | Values in expected range | expect_column_values_to_be_in_set |
| Accuracy | Data matches reality | Cross-reference validation |
| Consistency | No contradictions | expect_column_pair_values_A_to_be_greater_than_B |
| Timeliness | Data is recent | expect_column_max_to_be_between |
2. Testing Pyramid for Data
/\
/ \ Integration Tests (cross-table)
/────\
/ \ Unit Tests (single column)
/────────\
/ \ Schema Tests (structure)
/────────────\
Quick Start
Great Expectations Setup
# Install
pip install great_expectations
# Initialize project
great_expectations init
# Create datasource
great_expectations datasource new
# great_expectations/checkpoints/daily_validation.yml
import great_expectations as gx
# Create context
context = gx.get_context()
# Create expectation suite
suite = context.add_expectation_suite("orders_suite")
# Add expectations
suite.add_expectation(
gx.expectations.ExpectColumnValuesToNotBeNull(column="order_id")
)
suite.add_expectation(
gx.expectations.ExpectColumnValuesToBeUnique(column="order_id")
)
# Validate
results = context.run_checkpoint(checkpoint_name="daily_orders")
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Summary: {total_passed}/{total_tables} tables passed")
report.append("")
for table, result in results.items():
status = "✅" if result.passed else "❌"
report.append(f"### {status} {table}")
report.append(f"- Expectations: {result.total_expectations}")
report.append(f"- Failed: {result.failed_expectations}")
if not result.passed:
report.append("- Failed checks:")
for detail in result.details:
if not detail["success"]:
report.append(f" - {detail['expectation']}: {detail['observed_value']}")
report.append("")
return "\n".join(report)
Usage
context = gx.get_context() pipeline = DataQualityPipeline(context)
tables_to_validate = { "orders": "orders_suite", "customers": "customers_suite", "products": "products_suite", }
results = pipeline.run_all(tables_to_validate) report = pipeline.generate_report(results)
Fail pipeline if any table failed
if not all(r.passed for r in results.values()): print(report) raise ValueError("Data quality checks failed!")
## Best Practices
### Do's
- **Test early** - Validate source data before transformations
- **Test incrementally** - Add tests as you find issues
- **Document expectations** - Clear descriptions for each test
- **Alert on failures** - Integrate with monitoring
- **Version contracts** - Track schema changes
### Don'ts
- **Don't test everything** - Focus on critical columns
- **Don't ignore warnings** - They often precede failures
- **Don't skip freshness** - Stale data is bad data
- **Don't hardcode thresholds** - Use dynamic baselines
- **Don't test in isolation** - Test relationships too
| 1 | |
| 2 | name data-quality-frameworks |
| 3 | description Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts. |
| 4 | |
| 5 | |
| 6 | # Data Quality Frameworks |
| 7 | |
| 8 | Production patterns for implementing data quality with Great Expectations, dbt tests, and data contracts to ensure reliable data pipelines. |
| 9 | |
| 10 | ## When to Use This Skill |
| 11 | |
| 12 | Implementing data quality checks in pipelines |
| 13 | Setting up Great Expectations validation |
| 14 | Building comprehensive dbt test suites |
| 15 | Establishing data contracts between teams |
| 16 | Monitoring data quality metrics |
| 17 | Automating data validation in CI/CD |
| 18 | |
| 19 | ## Core Concepts |
| 20 | |
| 21 | ### 1. Data Quality Dimensions |
| 22 | |
| 23 | | Dimension | Description | Example Check | |
| 24 | | ---------------- | ------------------------ | -------------------------------------------------- | |
| 25 | | **Completeness** | No missing values | `expect_column_values_to_not_be_null` | |
| 26 | | **Uniqueness** | No duplicates | `expect_column_values_to_be_unique` | |
| 27 | | **Validity** | Values in expected range | `expect_column_values_to_be_in_set` | |
| 28 | | **Accuracy** | Data matches reality | Cross-reference validation | |
| 29 | | **Consistency** | No contradictions | `expect_column_pair_values_A_to_be_greater_than_B` | |
| 30 | | **Timeliness** | Data is recent | `expect_column_max_to_be_between` | |
| 31 | |
| 32 | ### 2. Testing Pyramid for Data |
| 33 | |
| 34 | |
| 35 | /\ |
| 36 | / \ Integration Tests (cross-table) |
| 37 | /────\ |
| 38 | / \ Unit Tests (single column) |
| 39 | /────────\ |
| 40 | / \ Schema Tests (structure) |
| 41 | /────────────\ |
| 42 | |
| 43 | |
| 44 | ## Quick Start |
| 45 | |
| 46 | ### Great Expectations Setup |
| 47 | |
| 48 | |
| 49 | # Install |
| 50 | pip install great_expectations |
| 51 | |
| 52 | # Initialize project |
| 53 | great_expectations init |
| 54 | |
| 55 | # Create datasource |
| 56 | great_expectations datasource new |
| 57 | |
| 58 | |
| 59 | |
| 60 | # great_expectations/checkpoints/daily_validation.yml |
| 61 | import great_expectations as gx |
| 62 | |
| 63 | # Create context |
| 64 | context = gx.get_context() |
| 65 | |
| 66 | # Create expectation suite |
| 67 | suite = context.add_expectation_suite("orders_suite") |
| 68 | |
| 69 | # Add expectations |
| 70 | suite.add_expectation( |
| 71 | gx.expectations.ExpectColumnValuesToNotBeNull(column="order_id") |
| 72 | ) |
| 73 | suite.add_expectation( |
| 74 | gx.expectations.ExpectColumnValuesToBeUnique(column="order_id") |
| 75 | ) |
| 76 | |
| 77 | # Validate |
| 78 | results = context.run_checkpoint(checkpoint_name="daily_orders") |
| 79 | |
| 80 | |
| 81 | ## Detailed patterns and worked examples |
| 82 | |
| 83 | Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient. |
| 84 | |
| 85 | ## Summary: {total_passed}/{total_tables} tables passed") |
| 86 | report.append("") |
| 87 | |
| 88 | for table, result in results.items(): |
| 89 | status = "✅" if result.passed else "❌" |
| 90 | report.append(f"### {status} {table}") |
| 91 | report.append(f"- Expectations: {result.total_expectations}") |
| 92 | report.append(f"- Failed: {result.failed_expectations}") |
| 93 | |
| 94 | if not result.passed: |
| 95 | report.append("- Failed checks:") |
| 96 | for detail in result.details: |
| 97 | if not detail["success"]: |
| 98 | report.append(f" - {detail['expectation']}: {detail['observed_value']}") |
| 99 | report.append("") |
| 100 | |
| 101 | return "\n".join(report) |
| 102 | |
| 103 | # Usage |
| 104 | context = gx.get_context() |
| 105 | pipeline = DataQualityPipeline(context) |
| 106 | |
| 107 | tables_to_validate = { |
| 108 | "orders": "orders_suite", |
| 109 | "customers": "customers_suite", |
| 110 | "products": "products_suite", |
| 111 | } |
| 112 | |
| 113 | results = pipeline.run_all(tables_to_validate) |
| 114 | report = pipeline.generate_report(results) |
| 115 | |
| 116 | # Fail pipeline if any table failed |
| 117 | if not all(r.passed for r in results.values()): |
| 118 | print(report) |
| 119 | raise ValueError("Data quality checks failed!") |
| 120 | |
| 121 | |
| 122 | ## Best Practices |
| 123 | |
| 124 | ### Do's |
| 125 | |
| 126 | - **Test early** - Validate source data before transformations |
| 127 | - **Test incrementally** - Add tests as you find issues |
| 128 | - **Document expectations** - Clear descriptions for each test |
| 129 | - **Alert on failures** - Integrate with monitoring |
| 130 | - **Version contracts** - Track schema changes |
| 131 | |
| 132 | ### Don'ts |
| 133 | |
| 134 | - **Don't test everything** - Focus on critical columns |
| 135 | - **Don't ignore warnings** - They often precede failures |
| 136 | - **Don't skip freshness** - Stale data is bad data |
| 137 | - **Don't hardcode thresholds** - Use dynamic baselines |
| 138 | - **Don't test in isolation** - Test relationships too |
| 139 |
Details
- Updated
- Sep 21, 2026
- License
- MIT
- Stars on the repo
- ★ 39,857
- Checked
- Source
- wshobson/agents ↗
- Creator
- wshobson · 179 listings
Similar skills
See all →
SkillTranslates Snowflake dbt SQL models to Standardized BigQuerydbt Snowflake to BigQuery Translator
SkillAnswering business analytics, RevOps, GTM metric, pipelineDeepline analytics
SkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patterns
SkillOptimize Apache Spark jobs with partitioning, cachingApache Spark Optimization
SkillMaster dbt for analytics engineering with model organizationDbt transformation patterns
SkillAudit datasets for completeness, consistency, accuracyData quality auditorMore from wshobson
SkillMaster C/.NET backend development patterns for building
SkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliance
SkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Design
SkillMigrate from AngularJS to Angular using hybrid modeAngular migration
SkillUnderstand anti-reversing, obfuscationAnti reversing techniques
SkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patterns