soda

担任 Soda 数据质量平台专家 — 帮助开发者编写 YAML 格式的数据质量检查,以验证数据的新鲜度、完整性、唯一性、有效性和业务规则,从而在数据问题影响仪表板和机器学习模型之前发现并处理问题。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
7

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "soda":https://skillpi.com/zh/skills/deepskill-6edd2bc4fcd9fd0b8bde9bf19ec374143b6b53e5469b96b8e588360432d369f5。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

担任 Soda 数据质量平台专家 — 帮助开发者编写 YAML 格式的数据质量检查,以验证数据的新鲜度、完整性、唯一性、有效性和业务规则,从而在数据问题影响仪表板和机器学习模型之前发现并处理问题。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: soda
description: >-
  You are an expert in Soda, the data quality platform for testing,
  monitoring, and profiling data. You help developers write data quality
  checks in YAML that validate freshness, completeness, uniqueness, validity,
  and business rules — catching data issues before they reach dashboards and
  ML models.
license: Apache-2.0
compatibility: ''
metadata:
  author: terminal-skills
  version: 1.0.0
  category: Data Engineering
  tags:
    - data-quality
    - testing
    - monitoring
    - data-observability
    - validation
    - open-source

Soda — Data Quality Testing and Monitoring

You are an expert in Soda, the data quality platform for testing, monitoring, and profiling data. You help developers write data quality checks in YAML that validate freshness, completeness, uniqueness, validity, and business rules — catching data issues before they reach dashboards and ML models.

Core Capabilities

Check Definitions

# checks/orders_checks.yaml — Data quality checks

checks for orders:
  # Freshness — data should be recent
  - freshness(created_at) < 2h:
      name: "Order data is fresh"

  # Row count — catch pipeline breaks
  - row_count > 0:
      name: "Orders table is not empty"
  - row_count between 100 and 10000:
      name: "Daily order volume is normal"

  # Completeness — no missing critical fields
  - missing_count(customer_id) = 0:
      name: "Every order has a customer"
  - missing_count(total_amount) = 0
  - missing_percent(shipping_address) < 5%:
      name: "Less than 5% missing addresses"

  # Uniqueness — no duplicates
  - duplicate_count(order_id) = 0:
      name: "No duplicate order IDs"

  # Validity — correct values
  - invalid_count(status) = 0:
      valid values: [pending, processing, shipped, delivered, cancelled, refunded]
  - invalid_count(total_amount) = 0:
      valid min: 0
      name: "No negative order amounts"

  # Business rules — custom SQL
  - failed_rows:
      fail query: |
        SELECT * FROM orders
        WHERE status = 'delivered' AND delivered_at IS NULL
      name: "Delivered orders must have delivery date"

  # Anomaly detection — ML-based
  - anomaly detection for row_count:
      name: "No unusual spikes or drops in order volume"
      severity: warn

  # Schema — structural checks
  - schema:
      fail:
        when required column missing: [order_id, customer_id, total_amount, status, created_at]
      warn:
        when forbidden column present: [__deleted, _temp_*]

Configuration and Running

# configuration.yml — Soda connection config
data_source my_warehouse:
  type: bigquery
  project_id: my-project
  dataset: analytics
  credentials: ${GCP_CREDENTIALS}

# Alternative: PostgreSQL
data_source my_postgres:
  type: postgres
  host: localhost
  port: 5432
  database: analytics
  username: ${DB_USER}
  password: ${DB_PASS}
# Run checks
soda scan -d my_warehouse -c configuration.yml checks/orders_checks.yaml

# Run all checks in a directory
soda scan -d my_warehouse -c configuration.yml checks/

# Output:
# Soda Library 1.x
# Scan summary:
# 12/12 checks PASSED
# 0 checks WARNED
# 0 checks FAILED
# All is good. No failures. No warnings. No errors.

CI/CD Integration

# .github/workflows/data-quality.yml
name: Data Quality Checks
on:
  schedule:
    - cron: "0 */4 * * *"                # Every 4 hours
  workflow_dispatch:                       # Manual trigger

jobs:
  soda-scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - run: pip install soda-core-bigquery
      - run: soda scan -d warehouse -c soda/configuration.yml soda/checks/
        env:
          GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }}
      - name: Notify on failure
        if: failure()
        uses: slackapi/slack-github-action@v1
        with:
          payload: '{"text": "⚠️ Data quality check failed! Check GitHub Actions."}'

Programmatic Usage

from soda.scan import Scan

scan = Scan()
scan.set_data_source_name("my_warehouse")
scan.add_configuration_yaml_file("configuration.yml")
scan.add_sodacl_yaml_str("""
checks for customers:
  - row_count > 0
  - missing_count(email) = 0
  - duplicate_count(email) = 0
""")

scan.execute()
print(scan.get_scan_results())

if scan.has_check_fails():
    # Trigger alert, block pipeline, etc.
    raise Exception(f"Data quality checks failed: {scan.get_checks_fail_text()}")

Installation

pip install soda-core-bigquery            # BigQuery
pip install soda-core-postgres            # PostgreSQL
pip install soda-core-snowflake           # Snowflake
pip install soda-core-duckdb             # DuckDB

Best Practices

  1. Check after every sync — Run Soda checks after Airbyte/dbt runs; catch issues before they reach dashboards
  2. Freshness checks first — Start with freshness() checks; stale data is the most common silent failure
  3. Anomaly detection — Use ML-based anomaly detection for volume and metric checks; catches issues you can't anticipate
  4. Failed rows for debugging — Use failed_rows with fail query for business logic checks; shows exactly which rows are bad
  5. Severity levels — Use severity: warn for non-critical checks; fail (default) blocks pipelines
  6. Schema checks — Validate required columns exist; catches upstream schema changes before they break transforms
  7. CI/CD integration — Run checks on schedule and in PR pipelines for dbt model changes
  8. Soda Cloud — Use Soda Cloud for historical trends, dashboards, and incident management; CLI is free for basic checks

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 面向数据工程领域的专业工具,解决数据质量监控的实际痛点
  • 提供完整的数据质量检查能力:新鲜度、完整性、唯一性、有效性、业务规则
  • 支持多种主流数据库平台,适用性强
触发精准92/100

亮点

  • 触发词精准覆盖 Soda 平台核心功能和使用场景
  • 边界清晰,专注于数据质量检查领域
  • 包含平台名称、核心能力、技术栈等关键识别信息
结构规范95/100

待提升项

  • description 内容重复 原报告严重程度:轻微

    description 同时在 frontmatter 和 skill_body 中出现,内容基本一致

    改进建议:建议移除 skill_body 中的重复 description,保持信息唯一性

亮点

  • 结构完整,从基础概念到高级用法层层递进
  • 提供丰富的端到端示例,涵盖 YAML 配置、命令行使用、CI/CD 集成、Python API
  • 包含最佳实践指南,提升用户使用效果
执行可靠90/100

亮点

  • 工具来源明确,提供官方安装命令和包名
  • 参数使用准确,YAML 语法和命令行参数规范
  • 支持异常分级处理(severity: warn/fail)和失败行调试
  • 覆盖多种数据库类型,适应不同技术栈需求
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。