[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6HR5AFGKY5MH42YCYRS9A66":3,"skill-same:01M6HR5AFGKY5MH42YCYRS9A66":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":53,"install":54,"resources":67},"01M6HR5AFGKY5MH42YCYRS9A66","data-quality-frameworks",null,"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.","welflau\u002Fai-dev-system","welflau","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F7010385?v=4","01M6HPTDGF18RFY07M229P8CTM","01M6HPTDMRMZCJPYBFEA9XVVYT",3,"MIT","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fdata-engineering\u002Fskills\u002Fdata-quality-frameworks\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"data","data quality","quality","frameworks","data quality frameworks","pipelines","when","data contracts","implementing","with","great expectations","tests","contracts","implement","use","Rules","validation","dbt","quality validation","2026-11-10 10:12:30",false,"---\nname: data-quality-frameworks\ndescription: 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.\n---\n\n# Data Quality Frameworks\n\nProduction patterns for implementing data quality with Great Expectations, dbt tests, and data contracts to ensure reliable data pipelines.\n\n## When to Use This Skill\n\n- Implementing data quality checks in pipelines\n- Setting up Great Expectations validation\n- Building comprehensive dbt test suites\n- Establishing data contracts between teams\n- Monitoring data quality metrics\n- Automating data validation in CI\u002FCD\n\n## Core Concepts\n\n### 1. Data Quality Dimensions\n\n| Dimension | Description | Example Check |\n|-----------|-------------|---------------|\n| **Completeness** | No missing values | `expect_column_values_to_not_be_null` |\n| **Uniqueness** | No duplicates | `expect_column_values_to_be_unique` |\n| **Validity** | Values in expected range | `expect_column_values_to_be_in_set` |\n| **Accuracy** | Data matches reality | Cross-reference validation |\n| **Consistency** | No contradictions | `expect_column_pair_values_A_to_be_greater_than_B` |\n| **Timeliness** | Data is recent | `expect_column_max_to_be_between` |\n\n### 2. Testing Pyramid for Data\n\n```\n          \u002F\\\n         \u002F  \\     Integration Tests (cross-table)\n        \u002F────\\\n       \u002F      \\   Unit Tests (single column)\n      \u002F────────\\\n     \u002F          \\ Schema Tests (structure)\n    \u002F────────────\\\n```\n\n## Quick Start\n\n### Great Expectations Setup\n\n```bash\n# Install\npip install great_expectations\n\n# Initialize project\ngreat_expectations init\n\n# Create datasource\ngreat_expectations datasource new\n```\n\n```python\n# great_expectations\u002Fcheckpoints\u002Fdaily_validation.yml\nimport great_expectations as gx\n\n# Create context\ncontext = gx.get_context()\n\n# Create expectation suite\nsuite = context.add_expectation_suite(\"orders_suite\")\n\n# Add expectations\nsuite.add_expectation(\n    gx.expectations.ExpectColumnValuesToNotBeNull(column=\"order_id\")\n)\nsuite.add_expectation(\n    gx.expectations.ExpectColumnValuesToBeUnique(column=\"order_id\")\n)\n\n# Validate\nresults = context.run_checkpoint(checkpoint_name=\"daily_orders\")\n```\n\n## Patterns\n\n### Pattern 1: Great Expectations Suite\n\n```python\n# expectations\u002Forders_suite.py\nimport great_expectations as gx\nfrom great_expectations.core import ExpectationSuite\nfrom great_expectations.core.expectation_configuration import ExpectationConfiguration\n\ndef build_orders_suite() -> ExpectationSuite:\n    \"\"\"Build comprehensive orders expectation suite\"\"\"\n\n    suite = ExpectationSuite(expectation_suite_name=\"orders_suite\")\n\n    # Schema expectations\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_table_columns_to_match_set\",\n        kwargs={\n            \"column_set\": [\"order_id\", \"customer_id\", \"amount\", \"status\", \"created_at\"],\n            \"exact_match\": False  # Allow additional columns\n        }\n    ))\n\n    # Primary key\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_not_be_null\",\n        kwargs={\"column\": \"order_id\"}\n    ))\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_be_unique\",\n        kwargs={\"column\": \"order_id\"}\n    ))\n\n    # Foreign key\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_not_be_null\",\n        kwargs={\"column\": \"customer_id\"}\n    ))\n\n    # Categorical values\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_be_in_set\",\n        kwargs={\n            \"column\": \"status\",\n            \"value_set\": [\"pending\", \"processing\", \"shipped\", \"delivered\", \"cancelled\"]\n        }\n    ))\n\n    # Numeric ranges\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_be_between\",\n        kwargs={\n            \"column\": \"amount\",\n            \"min_value\": 0,\n            \"max_value\": 100000,\n            \"strict_min\": True  # amount > 0\n        }\n    ))\n\n    # Date validity\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_be_dateutil_parseable\",\n        kwargs={\"column\": \"created_at\"}\n    ))\n\n    # Freshness - data should be recent\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_max_to_be_between\",\n        kwargs={\n            \"column\": \"created_at\",\n            \"min_value\": {\"$PARAMETER\": \"now - timedelta(days=1)\"},\n            \"max_value\": {\"$PARAMETER\": \"now\"}\n        }\n    ))\n\n    # Row count sanity\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_table_row_count_to_be_between\",\n        kwargs={\n            \"min_value\": 1000,  # Expect at least 1000 rows\n            \"max_value\": 10000000\n        }\n    ))\n\n    # Statistical expectations\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_mean_to_be_between\",\n        kwargs={\n            \"column\": \"amount\",\n            \"min_value\": 50,\n            \"max_value\": 500\n        }\n    ))\n\n    return suite\n```\n\n### Pattern 2: Great Expectations Checkpoint\n\n```yaml\n# great_expectations\u002Fcheckpoints\u002Forders_checkpoint.yml\nname: orders_checkpoint\nconfig_version: 1.0\nclass_name: Checkpoint\nrun_name_template: \"%Y%m%d-%H%M%S-orders-validation\"\n\nvalidations:\n  - batch_request:\n      datasource_name: warehouse\n      data_connector_name: default_inferred_data_connector_name\n      data_asset_name: orders\n      data_connector_query:\n        index: -1  # Latest batch\n    expectation_suite_name: orders_suite\n\naction_list:\n  - name: store_validation_result\n    action:\n      class_name: StoreValidationResultAction\n\n  - name: store_evaluation_parameters\n    action:\n      class_name: StoreEvaluationParametersAction\n\n  - name: update_data_docs\n    action:\n      class_name: UpdateDataDocsAction\n\n  # Slack notification on failure\n  - name: send_slack_notification\n    action:\n      class_name: SlackNotificationAction\n      slack_webhook: ${SLACK_WEBHOOK}\n      notify_on: failure\n      renderer:\n        module_name: great_expectations.render.renderer.slack_renderer\n        class_name: SlackRenderer\n```\n\n```python\n# Run checkpoint\nimport great_expectations as gx\n\ncontext = gx.get_context()\nresult = context.run_checkpoint(checkpoint_name=\"orders_checkpoint\")\n\nif not result.success:\n    failed_expectations = [\n        r for r in result.run_results.values()\n        if not r.success\n    ]\n    raise ValueError(f\"Data quality check failed: {failed_expectations}\")\n```\n\n### Pattern 3: dbt Data Tests\n\n```yaml\n# models\u002Fmarts\u002Fcore\u002F_core__models.yml\nversion: 2\n\nmodels:\n  - name: fct_orders\n    description: Order fact table\n    tests:\n      # Table-level tests\n      - dbt_utils.recency:\n          datepart: day\n          field: created_at\n          interval: 1\n      - dbt_utils.at_least_one\n      - dbt_utils.expression_is_true:\n          expression: \"total_amount >= 0\"\n\n    columns:\n      - name: order_id\n        description: Primary key\n        tests:\n          - unique\n          - not_null\n\n      - name: customer_id\n        description: Foreign key to dim_customers\n        tests:\n          - not_null\n          - relationships:\n              to: ref('dim_customers')\n              field: customer_id\n\n      - name: order_status\n        tests:\n          - accepted_values:\n              values: ['pending', 'processing', 'shipped', 'delivered', 'cancelled']\n\n      - name: total_amount\n        tests:\n          - not_null\n          - dbt_utils.expression_is_true:\n              expression: \">= 0\"\n\n      - name: created_at\n        tests:\n          - not_null\n          - dbt_utils.expression_is_true:\n              expression: \"\u003C= current_timestamp\"\n\n  - name: dim_customers\n    columns:\n      - name: customer_id\n        tests:\n          - unique\n          - not_null\n\n      - name: email\n        tests:\n          - unique\n          - not_null\n          # Custom regex test\n          - dbt_utils.expression_is_true:\n              expression: \"email ~ '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Za-z]{2,}$'\"\n```\n\n### Pattern 4: Custom dbt Tests\n\n```sql\n-- tests\u002Fgeneric\u002Ftest_row_count_in_range.sql\n{% test row_count_in_range(model, min_count, max_count) %}\n\nwith row_count as (\n    select count(*) as cnt from {{ model }}\n)\n\nselect cnt\nfrom row_count\nwhere cnt \u003C {{ min_count }} or cnt > {{ max_count }}\n\n{% endtest %}\n\n-- Usage in schema.yml:\n-- tests:\n--   - row_count_in_range:\n--       min_count: 1000\n--       max_count: 10000000\n```\n\n```sql\n-- tests\u002Fgeneric\u002Ftest_sequential_values.sql\n{% test sequential_values(model, column_name, interval=1) %}\n\nwith lagged as (\n    select\n        {{ column_name }},\n        lag({{ column_name }}) over (order by {{ column_name }}) as prev_value\n    from {{ model }}\n)\n\nselect *\nfrom lagged\nwhere {{ column_name }} - prev_value != {{ interval }}\n  and prev_value is not null\n\n{% endtest %}\n```\n\n```sql\n-- tests\u002Fsingular\u002Fassert_orders_customers_match.sql\n-- Singular test: specific business rule\n\nwith orders_customers as (\n    select distinct customer_id from {{ ref('fct_orders') }}\n),\n\ndim_customers as (\n    select customer_id from {{ ref('dim_customers') }}\n),\n\norphaned_orders as (\n    select o.customer_id\n    from orders_customers o\n    left join dim_customers c using (customer_id)\n    where c.customer_id is null\n)\n\nselect * from orphaned_orders\n-- Test passes if this returns 0 rows\n```\n\n### Pattern 5: Data Contracts\n\n```yaml\n# contracts\u002Forders_contract.yaml\napiVersion: datacontract.com\u002Fv1.0.0\nkind: DataContract\nmetadata:\n  name: orders\n  version: 1.0.0\n  owner: data-platform-team\n  contact: data-team@company.com\n\ninfo:\n  title: Orders Data Contract\n  description: Contract for order event data from the ecommerce platform\n  purpose: Analytics, reporting, and ML features\n\nservers:\n  production:\n    type: snowflake\n    account: company.us-east-1\n    database: ANALYTICS\n    schema: CORE\n\nterms:\n  usage: Internal analytics only\n  limitations: PII must not be exposed in downstream marts\n  billing: Charged per query TB scanned\n\nschema:\n  type: object\n  properties:\n    order_id:\n      type: string\n      format: uuid\n      description: Unique order identifier\n      required: true\n      unique: true\n      pii: false\n\n    customer_id:\n      type: string\n      format: uuid\n      description: Customer identifier\n      required: true\n      pii: true\n      piiClassification: indirect\n\n    total_amount:\n      type: number\n      minimum: 0\n      maximum: 100000\n      description: Order total in USD\n\n    created_at:\n      type: string\n      format: date-time\n      description: Order creation timestamp\n      required: true\n\n    status:\n      type: string\n      enum: [pending, processing, shipped, delivered, cancelled]\n      description: Current order status\n\nquality:\n  type: SodaCL\n  specification:\n    checks for orders:\n      - row_count > 0\n      - missing_count(order_id) = 0\n      - duplicate_count(order_id) = 0\n      - invalid_count(status) = 0:\n          valid values: [pending, processing, shipped, delivered, cancelled]\n      - freshness(created_at) \u003C 24h\n\nsla:\n  availability: 99.9%\n  freshness: 1 hour\n  latency: 5 minutes\n```\n\n### Pattern 6: Automated Quality Pipeline\n\n```python\n# quality_pipeline.py\nfrom dataclasses import dataclass\nfrom typing import List, Dict, Any\nimport great_expectations as gx\nfrom datetime import datetime\n\n@dataclass\nclass QualityResult:\n    table: str\n    passed: bool\n    total_expectations: int\n    failed_expectations: int\n    details: List[Dict[str, Any]]\n    timestamp: datetime\n\nclass DataQualityPipeline:\n    \"\"\"Orchestrate data quality checks across tables\"\"\"\n\n    def __init__(self, context: gx.DataContext):\n        self.context = context\n        self.results: List[QualityResult] = []\n\n    def validate_table(self, table: str, suite: str) -> QualityResult:\n        \"\"\"Validate a single table against expectation suite\"\"\"\n\n        checkpoint_config = {\n            \"name\": f\"{table}_validation\",\n            \"config_version\": 1.0,\n            \"class_name\": \"Checkpoint\",\n            \"validations\": [{\n                \"batch_request\": {\n                    \"datasource_name\": \"warehouse\",\n                    \"data_asset_name\": table,\n                },\n                \"expectation_suite_name\": suite,\n            }],\n        }\n\n        result = self.context.run_checkpoint(**checkpoint_config)\n\n        # Parse results\n        validation_result = list(result.run_results.values())[0]\n        results = validation_result.results\n\n        failed = [r for r in results if not r.success]\n\n        return QualityResult(\n            table=table,\n            passed=result.success,\n            total_expectations=len(results),\n            failed_expectations=len(failed),\n            details=[{\n                \"expectation\": r.expectation_config.expectation_type,\n                \"success\": r.success,\n                \"observed_value\": r.result.get(\"observed_value\"),\n            } for r in results],\n            timestamp=datetime.now()\n        )\n\n    def run_all(self, tables: Dict[str, str]) -> Dict[str, QualityResult]:\n        \"\"\"Run validation for all tables\"\"\"\n        results = {}\n\n        for table, suite in tables.items():\n            print(f\"Validating {table}...\")\n            results[table] = self.validate_table(table, suite)\n\n        return results\n\n    def generate_report(self, results: Dict[str, QualityResult]) -> str:\n        \"\"\"Generate quality report\"\"\"\n        report = [\"# Data Quality Report\", f\"Generated: {datetime.now()}\", \"\"]\n\n        total_passed = sum(1 for r in results.values() if r.passed)\n        total_tables = len(results)\n\n        report.append(f\"## Summary: {total_passed}\u002F{total_tables} tables passed\")\n        report.append(\"\")\n\n        for table, result in results.items():\n            status = \"✅\" if result.passed else \"❌\"\n            report.append(f\"### {status} {table}\")\n            report.append(f\"- Expectations: {result.total_expectations}\")\n            report.append(f\"- Failed: {result.failed_expectations}\")\n\n            if not result.passed:\n                report.append(\"- Failed checks:\")\n                for detail in result.details:\n                    if not detail[\"success\"]:\n                        report.append(f\"  - {detail['expectation']}: {detail['observed_value']}\")\n            report.append(\"\")\n\n        return \"\\n\".join(report)\n\n# Usage\ncontext = gx.get_context()\npipeline = DataQualityPipeline(context)\n\ntables_to_validate = {\n    \"orders\": \"orders_suite\",\n    \"customers\": \"customers_suite\",\n    \"products\": \"products_suite\",\n}\n\nresults = pipeline.run_all(tables_to_validate)\nreport = pipeline.generate_report(results)\n\n# Fail pipeline if any table failed\nif not all(r.passed for r in results.values()):\n    print(report)\n    raise ValueError(\"Data quality checks failed!\")\n```\n\n## Best Practices\n\n### Do's\n- **Test early** - Validate source data before transformations\n- **Test incrementally** - Add tests as you find issues\n- **Document expectations** - Clear descriptions for each test\n- **Alert on failures** - Integrate with monitoring\n- **Version contracts** - Track schema changes\n\n### Don'ts\n- **Don't test everything** - Focus on critical columns\n- **Don't ignore warnings** - They often precede failures\n- **Don't skip freshness** - Stale data is bad data\n- **Don't hardcode thresholds** - Use dynamic baselines\n- **Don't test in isolation** - Test relationships too\n\n## Resources\n\n- [Great Expectations Documentation](https:\u002F\u002Fdocs.greatexpectations.io\u002F)\n- [dbt Testing Documentation](https:\u002F\u002Fdocs.getdbt.com\u002Fdocs\u002Fbuild\u002Ftests)\n- [Data Contract Specification](https:\u002F\u002Fdatacontract.com\u002F)\n- [Soda Core](https:\u002F\u002Fdocs.soda.io\u002Fsoda-core\u002Foverview.html)\n","# Data Quality Frameworks\n\nProduction patterns for implementing data quality with Great Expectations, dbt tests, and data contracts to ensure reliable data pipelines.\n\n## When to Use This Skill\n\n- Implementing data quality checks in pipelines\n- Setting up Great Expectations validation\n- Building comprehensive dbt test suites\n- Establishing data contracts between teams\n- Monitoring data quality metrics\n- Automating data validation in CI\u002FCD\n\n## Core Concepts\n\n### 1. Data Quality Dimensions\n\n| Dimension | Description | Example Check |\n|-----------|-------------|---------------|\n| **Completeness** | No missing values | `expect_column_values_to_not_be_null` |\n| **Uniqueness** | No duplicates | `expect_column_values_to_be_unique` |\n| **Validity** | Values in expected range | `expect_column_values_to_be_in_set` |\n| **Accuracy** | Data matches reality | Cross-reference validation |\n| **Consistency** | No contradictions | `expect_column_pair_values_A_to_be_greater_than_B` |\n| **Timeliness** | Data is recent | `expect_column_max_to_be_between` |\n\n### 2. Testing Pyramid for Data\n\n```\n          \u002F\\\n         \u002F  \\     Integration Tests (cross-table)\n        \u002F────\\\n       \u002F      \\   Unit Tests (single column)\n      \u002F────────\\\n     \u002F          \\ Schema Tests (structure)\n    \u002F────────────\\\n```\n\n## Quick Start\n\n### Great Expectations Setup\n\n```bash\n# Install\npip install great_expectations\n\n# Initialize project\ngreat_expectations init\n\n# Create datasource\ngreat_expectations datasource new\n```\n\n```python\n# great_expectations\u002Fcheckpoints\u002Fdaily_validation.yml\nimport great_expectations as gx\n\n# Create context\ncontext = gx.get_context()\n\n# Create expectation suite\nsuite = context.add_expectation_suite(\"orders_suite\")\n\n# Add expectations\nsuite.add_expectation(\n    gx.expectations.ExpectColumnValuesToNotBeNull(column=\"order_id\")\n)\nsuite.add_expectation(\n    gx.expectations.ExpectColumnValuesToBeUnique(column=\"order_id\")\n)\n\n# Validate\nresults = context.run_checkpoint(checkpoint_name=\"daily_orders\")\n```\n\n## Patterns\n\n### Pattern 1: Great Expectations Suite\n\n```python\n# expectations\u002Forders_suite.py\nimport great_expectations as gx\nfrom great_expectations.core import ExpectationSuite\nfrom great_expectations.core.expectation_configuration import ExpectationConfiguration\n\ndef build_orders_suite() -> ExpectationSuite:\n    \"\"\"Build comprehensive orders expectation suite\"\"\"\n\n    suite = ExpectationSuite(expectation_suite_name=\"orders_suite\")\n\n    # Schema expectations\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_table_columns_to_match_set\",\n        kwargs={\n            \"column_set\": [\"order_id\", \"customer_id\", \"amount\", \"status\", \"created_at\"],\n            \"exact_match\": False  # Allow additional columns\n        }\n    ))\n\n    # Primary key\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_not_be_null\",\n        kwargs={\"column\": \"order_id\"}\n    ))\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_be_unique\",\n        kwargs={\"column\": \"order_id\"}\n    ))\n\n    # Foreign key\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_not_be_null\",\n        kwargs={\"column\": \"customer_id\"}\n    ))\n\n    # Categorical values\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_be_in_set\",\n        kwargs={\n            \"column\": \"status\",\n            \"value_set\": [\"pending\", \"processing\", \"shipped\", \"delivered\", \"cancelled\"]\n        }\n    ))\n\n    # Numeric ranges\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_be_between\",\n        kwargs={\n            \"column\": \"amount\",\n            \"min_value\": 0,\n            \"max_value\": 100000,\n            \"strict_min\": True  # amount > 0\n        }\n    ))\n\n    # Date validity\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_values_to_be_dateutil_parseable\",\n        kwargs={\"column\": \"created_at\"}\n    ))\n\n    # Freshness - data should be recent\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_max_to_be_between\",\n        kwargs={\n            \"column\": \"created_at\",\n            \"min_value\": {\"$PARAMETER\": \"now - timedelta(days=1)\"},\n            \"max_value\": {\"$PARAMETER\": \"now\"}\n        }\n    ))\n\n    # Row count sanity\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_table_row_count_to_be_between\",\n        kwargs={\n            \"min_value\": 1000,  # Expect at least 1000 rows\n            \"max_value\": 10000000\n        }\n    ))\n\n    # Statistical expectations\n    suite.add_expectation(ExpectationConfiguration(\n        expectation_type=\"expect_column_mean_to_be_between\",\n        kwargs={\n            \"column\": \"amount\",\n            \"min_value\": 50,\n            \"max_value\": 500\n        }\n    ))\n\n    return suite\n```\n\n### Pattern 2: Great Expectations Checkpoint\n\n```yaml\n# great_expectations\u002Fcheckpoints\u002Forders_checkpoint.yml\nname: orders_checkpoint\nconfig_version: 1.0\nclass_name: Checkpoint\nrun_name_template: \"%Y%m%d-%H%M%S-orders-validation\"\n\nvalidations:\n  - batch_request:\n      datasource_name: warehouse\n      data_connector_name: default_inferred_data_connector_name\n      data_asset_name: orders\n      data_connector_query:\n        index: -1  # Latest batch\n    expectation_suite_name: orders_suite\n\naction_list:\n  - name: store_validation_result\n    action:\n      class_name: StoreValidationResultAction\n\n  - name: store_evaluation_parameters\n    action:\n      class_name: StoreEvaluationParametersAction\n\n  - name: update_data_docs\n    action:\n      class_name: UpdateDataDocsAction\n\n  # Slack notification on failure\n  - name: send_slack_notification\n    action:\n      class_name: SlackNotificationAction\n      slack_webhook: ${SLACK_WEBHOOK}\n      notify_on: failure\n      renderer:\n        module_name: great_expectations.render.renderer.slack_renderer\n        class_name: SlackRenderer\n```\n\n```python\n# Run checkpoint\nimport great_expectations as gx\n\ncontext = gx.get_context()\nresult = context.run_checkpoint(checkpoint_name=\"orders_checkpoint\")\n\nif not result.success:\n    failed_expectations = [\n        r for r in result.run_results.values()\n        if not r.success\n    ]\n    raise ValueError(f\"Data quality check failed: {failed_expectations}\")\n```\n\n### Pattern 3: dbt Data Tests\n\n```yaml\n# models\u002Fmarts\u002Fcore\u002F_core__models.yml\nversion: 2\n\nmodels:\n  - name: fct_orders\n    description: Order fact table\n    tests:\n      # Table-level tests\n      - dbt_utils.recency:\n          datepart: day\n          field: created_at\n          interval: 1\n      - dbt_utils.at_least_one\n      - dbt_utils.expression_is_true:\n          expression: \"total_amount >= 0\"\n\n    columns:\n      - name: order_id\n        description: Primary key\n        tests:\n          - unique\n          - not_null\n\n      - name: customer_id\n        description: Foreign key to dim_customers\n        tests:\n          - not_null\n          - relationships:\n              to: ref('dim_customers')\n              field: customer_id\n\n      - name: order_status\n        tests:\n          - accepted_values:\n              values: ['pending', 'processing', 'shipped', 'delivered', 'cancelled']\n\n      - name: total_amount\n        tests:\n          - not_null\n          - dbt_utils.expression_is_true:\n              expression: \">= 0\"\n\n      - name: created_at\n        tests:\n          - not_null\n          - dbt_utils.expression_is_true:\n              expression: \"\u003C= current_timestamp\"\n\n  - name: dim_customers\n    columns:\n      - name: customer_id\n        tests:\n          - unique\n          - not_null\n\n      - name: email\n        tests:\n          - unique\n          - not_null\n          # Custom regex test\n          - dbt_utils.expression_is_true:\n              expression: \"email ~ '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Za-z]{2,}$'\"\n```\n\n### Pattern 4: Custom dbt Tests\n\n```sql\n-- tests\u002Fgeneric\u002Ftest_row_count_in_range.sql\n{% test row_count_in_range(model, min_count, max_count) %}\n\nwith row_count as (\n    select count(*) as cnt from {{ model }}\n)\n\nselect cnt\nfrom row_count\nwhere cnt \u003C {{ min_count }} or cnt > {{ max_count }}\n\n{% endtest %}\n\n-- Usage in schema.yml:\n-- tests:\n--   - row_count_in_range:\n--       min_count: 1000\n--       max_count: 10000000\n```\n\n```sql\n-- tests\u002Fgeneric\u002Ftest_sequential_values.sql\n{% test sequential_values(model, column_name, interval=1) %}\n\nwith lagged as (\n    select\n        {{ column_name }},\n        lag({{ column_name }}) over (order by {{ column_name }}) as prev_value\n    from {{ model }}\n)\n\nselect *\nfrom lagged\nwhere {{ column_name }} - prev_value != {{ interval }}\n  and prev_value is not null\n\n{% endtest %}\n```\n\n```sql\n-- tests\u002Fsingular\u002Fassert_orders_customers_match.sql\n-- Singular test: specific business rule\n\nwith orders_customers as (\n    select distinct customer_id from {{ ref('fct_orders') }}\n),\n\ndim_customers as (\n    select customer_id from {{ ref('dim_customers') }}\n),\n\norphaned_orders as (\n    select o.customer_id\n    from orders_customers o\n    left join dim_customers c using (customer_id)\n    where c.customer_id is null\n)\n\nselect * from orphaned_orders\n-- Test passes if this returns 0 rows\n```\n\n### Pattern 5: Data Contracts\n\n```yaml\n# contracts\u002Forders_contract.yaml\napiVersion: datacontract.com\u002Fv1.0.0\nkind: DataContract\nmetadata:\n  name: orders\n  version: 1.0.0\n  owner: data-platform-team\n  contact: data-team@company.com\n\ninfo:\n  title: Orders Data Contract\n  description: Contract for order event data from the ecommerce platform\n  purpose: Analytics, reporting, and ML features\n\nservers:\n  production:\n    type: snowflake\n    account: company.us-east-1\n    database: ANALYTICS\n    schema: CORE\n\nterms:\n  usage: Internal analytics only\n  limitations: PII must not be exposed in downstream marts\n  billing: Charged per query TB scanned\n\nschema:\n  type: object\n  properties:\n    order_id:\n      type: string\n      format: uuid\n      description: Unique order identifier\n      required: true\n      unique: true\n      pii: false\n\n    customer_id:\n      type: string\n      format: uuid\n      description: Customer identifier\n      required: true\n      pii: true\n      piiClassification: indirect\n\n    total_amount:\n      type: number\n      minimum: 0\n      maximum: 100000\n      description: Order total in USD\n\n    created_at:\n      type: string\n      format: date-time\n      description: Order creation timestamp\n      required: true\n\n    status:\n      type: string\n      enum: [pending, processing, shipped, delivered, cancelled]\n      description: Current order status\n\nquality:\n  type: SodaCL\n  specification:\n    checks for orders:\n      - row_count > 0\n      - missing_count(order_id) = 0\n      - duplicate_count(order_id) = 0\n      - invalid_count(status) = 0:\n          valid values: [pending, processing, shipped, delivered, cancelled]\n      - freshness(created_at) \u003C 24h\n\nsla:\n  availability: 99.9%\n  freshness: 1 hour\n  latency: 5 minutes\n```\n\n### Pattern 6: Automated Quality Pipeline\n\n```python\n# quality_pipeline.py\nfrom dataclasses import dataclass\nfrom typing import List, Dict, Any\nimport great_expectations as gx\nfrom datetime import datetime\n\n@dataclass\nclass QualityResult:\n    table: str\n    passed: bool\n    total_expectations: int\n    failed_expectations: int\n    details: List[Dict[str, Any]]\n    timestamp: datetime\n\nclass DataQualityPipeline:\n    \"\"\"Orchestrate data quality checks across tables\"\"\"\n\n    def __init__(self, context: gx.DataContext):\n        self.context = context\n        self.results: List[QualityResult] = []\n\n    def validate_table(self, table: str, suite: str) -> QualityResult:\n        \"\"\"Validate a single table against expectation suite\"\"\"\n\n        checkpoint_config = {\n            \"name\": f\"{table}_validation\",\n            \"config_version\": 1.0,\n            \"class_name\": \"Checkpoint\",\n            \"validations\": [{\n                \"batch_request\": {\n                    \"datasource_name\": \"warehouse\",\n                    \"data_asset_name\": table,\n                },\n                \"expectation_suite_name\": suite,\n            }],\n        }\n\n        result = self.context.run_checkpoint(**checkpoint_config)\n\n        # Parse results\n        validation_result = list(result.run_results.values())[0]\n        results = validation_result.results\n\n        failed = [r for r in results if not r.success]\n\n        return QualityResult(\n            table=table,\n            passed=result.success,\n            total_expectations=len(results),\n            failed_expectations=len(failed),\n            details=[{\n                \"expectation\": r.expectation_config.expectation_type,\n                \"success\": r.success,\n                \"observed_value\": r.result.get(\"observed_value\"),\n            } for r in results],\n            timestamp=datetime.now()\n        )\n\n    def run_all(self, tables: Dict[str, str]) -> Dict[str, QualityResult]:\n        \"\"\"Run validation for all tables\"\"\"\n        results = {}\n\n        for table, suite in tables.items():\n            print(f\"Validating {table}...\")\n            results[table] = self.validate_table(table, suite)\n\n        return results\n\n    def generate_report(self, results: Dict[str, QualityResult]) -> str:\n        \"\"\"Generate quality report\"\"\"\n        report = [\"# Data Quality Report\", f\"Generated: {datetime.now()}\", \"\"]\n\n        total_passed = sum(1 for r in results.values() if r.passed)\n        total_tables = len(results)\n\n        report.append(f\"## Summary: {total_passed}\u002F{total_tables} tables passed\")\n        report.append(\"\")\n\n        for table, result in results.items():\n            status = \"✅\" if result.passed else \"❌\"\n            report.append(f\"### {status} {table}\")\n            report.append(f\"- Expectations: {result.total_expectations}\")\n            report.append(f\"- Failed: {result.failed_expectations}\")\n\n            if not result.passed:\n                report.append(\"- Failed checks:\")\n                for detail in result.details:\n                    if not detail[\"success\"]:\n                        report.append(f\"  - {detail['expectation']}: {detail['observed_value']}\")\n            report.append(\"\")\n\n        return \"\\n\".join(report)\n\n# Usage\ncontext = gx.get_context()\npipeline = DataQualityPipeline(context)\n\ntables_to_validate = {\n    \"orders\": \"orders_suite\",\n    \"customers\": \"customers_suite\",\n    \"products\": \"products_suite\",\n}\n\nresults = pipeline.run_all(tables_to_validate)\nreport = pipeline.generate_report(results)\n\n# Fail pipeline if any table failed\nif not all(r.passed for r in results.values()):\n    print(report)\n    raise ValueError(\"Data quality checks failed!\")\n```\n\n## Best Practices\n\n### Do's\n- **Test early** - Validate source data before transformations\n- **Test incrementally** - Add tests as you find issues\n- **Document expectations** - Clear descriptions for each test\n- **Alert on failures** - Integrate with monitoring\n- **Version contracts** - Track schema changes\n\n### Don'ts\n- **Don't test everything** - Focus on critical columns\n- **Don't ignore warnings** - They often precede failures\n- **Don't skip freshness** - Stale data is bad data\n- **Don't hardcode thresholds** - Use dynamic baselines\n- **Don't test in isolation** - Test relationships too\n\n## Resources\n\n- [Great Expectations Documentation](https:\u002F\u002Fdocs.greatexpectations.io\u002F)\n- [dbt Testing Documentation](https:\u002F\u002Fdocs.getdbt.com\u002Fdocs\u002Fbuild\u002Ftests)\n- [Data Contract Specification](https:\u002F\u002Fdatacontract.com\u002F)\n- [Soda Core](https:\u002F\u002Fdocs.soda.io\u002Fsoda-core\u002Foverview.html)\n",{"name":5,"description":7},"main","18d0e63d1313ca87098f614aa7c1e2dcf6de79c7","backend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fdata-engineering\u002Fskills\u002Fdata-quality-frameworks",1,"https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system","https:\u002F\u002Fgithub.com\u002Fwelflau","2026-11-12 14:55:20",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add welflau\u002Fai-dev-system --skill data-quality-frameworks",{"tool":60,"command":61},"bunx","bunx skills add welflau\u002Fai-dev-system --skill data-quality-frameworks",{"tool":63,"command":64},"pnpm","pnpm dlx skills add welflau\u002Fai-dev-system --skill data-quality-frameworks","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fdata-engineering\u002Fskills\u002Fdata-quality-frameworks\u002FSKILL.md",true,[],[69,103,132,158,185,210],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":73,"licenseFileUrl":74,"sourceHtmlUrl":75,"categories":76,"keywords":85,"publishedAt":102},"01M6HS9Z4B0YA8CJCS2Y2F04Y3","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Fwebapp-testing\u002FSKILL.md",[77,82],{"categoryNo":78,"categoryName":79,"taxonomyType":80,"taxonomyTypeDesc":81},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":83,"categoryName":84,"taxonomyType":80,"taxonomyTypeDesc":81},"01JBSEEDCAT000000000000009","前端开发",[86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,32,101],"testing","webapp testing","webapp","frontend","screenshots","playwright","web","debugging","toolkit","browser","ui","logs","applications","behavior","local","for","2026-11-11 15:11:14",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":73,"licenseFileUrl":107,"sourceHtmlUrl":108,"categories":109,"keywords":113,"publishedAt":102},"01M6HRAGMG7JF0HXYHMA5QHS8A","internal-comms","A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Finternal-comms\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Finternal-comms\u002FSKILL.md",[110],{"categoryNo":111,"categoryName":112,"taxonomyType":80,"taxonomyTypeDesc":81},"01JBSEEDCAT000000000000005","邮件与沟通",[114,115,116,117,118,119,37,120,121,122,123,124,125,126,127,128,129,130,131],"internal comms","comms","status","help","SET","write","reports","me","incident","leadership","project","resources","communications","internal communications","formats","sort","my","updates",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":73,"licenseFileUrl":136,"sourceHtmlUrl":137,"categories":138,"keywords":140,"publishedAt":42},"01M6HSTDP4M3JFXEBK91VFB4PA","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Fweb-artifacts-builder\u002FSKILL.md",[139],{"categoryNo":83,"categoryName":84,"taxonomyType":80,"taxonomyTypeDesc":81},[141,92,142,143,144,89,145,146,147,148,149,150,151,152,37,153,154,155,156,101,157],"web artifacts builder","artifacts","artifacts builder","builder","css","components","react","routing","state management","state","file","Tailwind","single-file","simple","ui components","multi","single",{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":73,"licenseFileUrl":162,"sourceHtmlUrl":163,"categories":164,"keywords":172,"publishedAt":42},"01M6HSDXH0JSP8R3QTNY9XZ8HN","frontend-design","Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML\u002FCSS layouts, or when styling\u002Fbeautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Ffrontend-design\u002FSKILL.md",[165,166,169],{"categoryNo":83,"categoryName":84,"taxonomyType":80,"taxonomyTypeDesc":81},{"categoryNo":167,"categoryName":168,"taxonomyType":80,"taxonomyTypeDesc":81},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":170,"categoryName":171,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000032","设计师",[89,173,174,145,92,146,147,175,176,177,142,178,98,179,37,180,181,182,183,32,184,29],"design","frontend design","react components","create","code","examples","landing","ui design","pages","aesthetics","web ui","generic",{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":73,"licenseFileUrl":189,"sourceHtmlUrl":190,"categories":191,"keywords":193,"publishedAt":42},"01M6HSA77QYVP7A72HREGTDN2C","algorithmic-art","Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Falgorithmic-art\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fplugins\u002Falgorithmic-art\u002FSKILL.md",[192],{"categoryNo":167,"categoryName":168,"taxonomyType":80,"taxonomyTypeDesc":81},[194,195,196,176,177,197,198,199,200,37,201,202,203,204,32,205,206,207,208,209,29],"algorithmic art","Art","algorithmic","flow","js","work","interactive","generative art","exploration","systems","users","Existing","request","generative","copyright","fields",{"skillNo":211,"name":212,"nameZh":6,"description":213,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":73,"licenseFileUrl":214,"sourceHtmlUrl":215,"categories":216,"keywords":218,"publishedAt":42},"01M6HS9HE0X390Y6RQKTY1YNGJ","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fwelflau\u002Fai-dev-system\u002Fblob\u002Fmain\u002Fbackend\u002Fskills\u002Fmarketplace\u002Fcodebuddy-plugins-official\u002Fexternal_plugins\u002Ftheme-factory\u002FSKILL.md",[217],{"categoryNo":167,"categoryName":168,"taxonomyType":80,"taxonomyTypeDesc":81},[219,220,221,222,94,223,142,118,224,225,179,226,227,181,228,32,229,230,231,101,232,233],"theme factory","factory","theme","docs","generate","fly","slides","styling","artifact","themes","you","fonts","can","apply","new"]