Community研究&データ分析github.com

デバッグデータパイプライン

パイプライン障害やデータインシデント(ジョブエラー、データの誤り・欠落・重複、鮮度不足)を体系的に根本原因特定するためのスキルです。上流のリネージを辿り、障害段階を特定し、ソースと照合し、安全な修正とバックフィルを計画します。パイプラインが失敗した、数値がおかしい、データが欠けている/重複している、ダッシュボードが古い、またはステークホルダーからデータ不一致の報告があった場合に使用します。

デバッグデータパイプライン とは?

このスキルは、データパイプラインの障害やデータ品質インシデントを体系的にデバッグするためのワークフローとパターン集です。ジョブの実行失敗だけでなく、出力データの誤りや欠損、重複といったデータ正しさに関する問題を扱います。主なワークフローは、症状の特定→リネージの二分探索による原因段階の特定→原因分類(コードバグ、入力データ不良、実行失敗、非冪等重複)→ソースとの照合による確認→修正とバックフィルの計画→再発防止策の追加、というステップで構成されます。特徴的なパターンとして、DAGを二分探索で上流に遡る「リネージ二分探索」や、SQLによる行数・合計値の比較でデータズレの箇所を突き止める「ソースvsターゲット照合」があります。このスキルはClaude CodeやCursor, CodexなどのAIエージェントで利用可能で、`debugging-dbt-runs`や`debugging-airflow-pipelines`といったツール固有のデバッグスキルと併用することで、データパイプラインのあらゆる不具合に包括的に対処できます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Unknown-333/awesome-data-engineering-skills/tree/main/skills/debugging-data-pipelines

Installed? Explore more 研究&データ分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

データパイプラインのデバッグ

使用すべきタイミング

  • パイプラインジョブが失敗した、または出力データが誤っている/欠けている/重複している。
  • ダッシュボードが古い、またはメトリクスがソースと一致しない。
  • ステークホルダーが不一致を報告し、原因を特定する必要がある。
  • ツール固有の実行エラーが既に debugging-dbt-runs / debugging-airflow-pipelines でカバーされている場合は、そちらを先に使用してください(そちらから始め、データ正しさのインシデントには本スキルを使用)。

ワークフロー

- [ ] 症状を正確に定義する(どのテーブル、カラム、行、時間範囲)
- [ ] 上流のリネージを辿り、データが最初に誤った段階を見つける
- [ ] 原因を分類する:コードバグ、入力データ不良、遅延データ、実行失敗?
- [ ] 疑わしい段階をそのソースと照合する(行数/合計値)
- [ ] 根本原因を修正し、影響を受けた時間帯の冪等なバックフィルを計画する
- [ ] 再発を防ぐチェックを追加する
  1. 症状を特定する。 「fct_orders の2026-01-15の収益が約30%低い」はデバッグ可能ですが、「数値がおかしい」はデバッグできません。テーブル、カラム、行、時間範囲を特定します。
  2. 上流のリネージを辿る。 誤った出力からモデル/タスクを逆向きにたどり、データが既に誤っている最初の段階を見つけます。すべての段階を読むのではなく、DAGを二分探索します。
  3. 原因を分類する: コード変更、入力データの不良/遅延、失敗/部分的な実行、または非冪等な重複。
  4. 疑わしい段階をその入力と照合する(行数、キー数、合計値)ことで、差分がどこで発生したかを確認します。
  5. 修正 + バックフィル 影響を受けた時間帯を冪等に実行します(designing-backfills-and-replays を参照)。
  6. 再発防止 対象を絞ったデータ品質チェックを追加します。

パターン

リネージ二分探索 — DAGの中間地点の段階をチェックします。そのデータが正しければバグは下流、誤っていればさらに上流へ。これを繰り返します。

ソース vs ターゲットの照合 を影響を受けた時間帯に対して行います:

-- 影響を受けた時間帯において、その段階と入力との間で件数・合計は一致するか?
SELECT 'source' AS layer, COUNT(*) n, SUM(amount) total
FROM staging.orders WHERE order_date = DATE '2026-01-15'
UNION ALL
SELECT 'target', COUNT(*), SUM(amount)
FROM marts.fct_orders WHERE order_date = DATE '2026-01-15';

件数が不一致 → 行のドロップ/フィルター、または失敗した部分ロード。件数が一致して合計値が不一致 → 変換・ロジックバグ。ターゲットの件数が多い → 重複(非冪等ロード)。

タイムラインチェック — インシデントの時間帯を、デプロイ、ソーススキーマ変更、実行履歴と関連付けます。ほとんどのインシデントは変更から始まります。

よくある落とし穴

  • 下流で症状を修正する — バグがステージングにあるのにマートにパッチを当てると再発します。最初の不良段階を修正しましょう。
  • 本番データに手動で一回限りの修正を加える — 監査できず再現性もありません。代わりにコードを修正し、冪等に再実行しましょう。
  • DAG全体を線形に読む — 代わりにリネージの二分探索を行いましょう。
  • 照合をスキップする — どこでデータが乖離したかを推測すると時間を浪費します。段階ごとに件数と合計値を測定しましょう。
  • 修正後に予防的チェックを追加しない — 同じ種類のバグが気付かれずに再発します。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

Unknown-333/authoring-airflow-dags

Write production-grade Apache Airflow DAGs using the TaskFlow API — idempotent tasks, correct scheduling and catchup, retries/SLAs, connections/variables, and avoiding top-level code. Use when creating or reviewing Airflow DAGs, scheduling pipelines, wiring task dependencies, configuring retries/backfills, or fixing non-idempotent tasks.

Unknown-333/building-dagster-assets

Build Dagster pipelines using software-defined assets — asset dependencies, partitions, resources and IO managers, asset checks, and schedules/sensors. Use when creating Dagster assets or jobs, modeling data as assets, adding partitions or backfills, wiring resources/IO managers, or migrating from task-based orchestration to assets.

Unknown-333/building-dbt-models

Build well-structured dbt models — staging/intermediate/marts layers, ref() and source(), materializations, and incremental models with the right strategy. Use when creating or refactoring dbt models, choosing table vs view vs incremental, structuring a dbt project, or writing incremental logic.

Unknown-333/building-feature-pipelines

Build ML feature pipelines and feature stores — point-in-time-correct joins to avoid label leakage, offline/online parity, feature freshness and backfills, and materialization with tools like Feast. Use when engineering features for ML, preventing train/serve skew or data leakage, building a feature store, or backfilling historical features for training.

Unknown-333/building-iceberg-tables

Design and operate Apache Iceberg tables — partitioning and hidden partitioning, partition/schema evolution, snapshots and time travel, compaction and small-file cleanup, and MERGE/upsert for lakehouse tables on Spark, Flink, Trino, or Snowflake. Use when creating or maintaining Iceberg tables, choosing partitioning, evolving schema/partitions, or fixing small-file and metadata bloat.

Unknown-333/building-ingestion-pipelines

Build batch and incremental data ingestion (extract-load) pipelines — full vs incremental extraction, change data capture (CDC), watermarks and high-water marks, API pagination and rate limits, and choosing managed EL tools (Fivetran, Airbyte) vs custom code. Use when ingesting data from databases, APIs, files, or SaaS into a warehouse/lake, or designing incremental extraction and CDC.

Unknown-333/building-kafka-consumers

Build reliable Apache Kafka consumers and producers — consumer groups and partition assignment, offset commit strategy, at-least-once vs exactly-once, idempotent/transactional producers, rebalancing, and dead-letter handling. Use when writing Kafka consumers/producers, configuring offset commits or consumer groups, tuning throughput, or handling rebalances and poison messages.

Unknown-333/designing-backfills-and-replays

Plan and run safe data backfills and replays — idempotent reprocessing of historical windows, partition-by-partition execution, isolating backfill compute from production, verifying results, and avoiding double-counting or changed history. Use when backfilling a new or fixed model, reprocessing after a bug, replaying events, or loading history for a new pipeline without corrupting existing data.

Unknown-333/designing-data-contracts

Define and enforce data contracts between producers and consumers — explicit schema, semantics, ownership, SLAs, and versioning — to prevent silent upstream changes from breaking downstream pipelines. Use when a producer schema change could break consumers, defining an interface between teams/services and the warehouse, or adding schema enforcement at ingestion.

関連スキル