debugging-failed-data-quality-checks
Skill này làm gì
Skill này giải thích vì sao một kiểm tra dữ liệu bị đỏ, hiển thị các dòng gây ra lỗi và gợi ý cần thay đổi gì. Nó dành cho người duy trì dữ liệu kho và cần xử lý một kiểm tra đang lỗi.
Khi nào nên dùng
- ✓Khi một kiểm tra chất lượng dữ liệu hiển thị failed hoặc errored và bạn muốn biết nguyên nhân.
- ✓Khi bạn muốn xem các dòng cụ thể mà một kiểm tra đã khớp.
- ✓Khi một materialized view hiển thị thông báo Not published hoặc dữ liệu cũ sau khi làm mới.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/products/data_quality/skills/debugging-failed-data-quality-checks/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Vì sao kiểm tra tính duy nhất của bảng đơn hàng của tôi thất bại, và các dòng trùng lặp là những dòng nào?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill đọc trạng thái của kiểm tra trước, vì điều đó cho thấy vấn đề nằm ở dữ liệu, ở chính kiểm tra, hay ở một truy vấn không chạy được. Sau đó, skill xem các dòng khớp.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Debugging failed data quality checks
A check run ends in one of four states. Read the state first, because it decides where the problem is:
| Status | Meaning | Where to look |
|---|---|---|
failed |
The query ran and the assertion found bad data | The data, or the assertion itself |
errored |
The query could not run, so nothing was judged | The error text (never a data problem) |
skipped |
The subject is gone | Whether the table or view still exists |
passed |
The assertion held | Nothing |
row_count and freshness checks judge observed_value, not failed_row_count.
A failed row_count means the count fell outside its bounds.
A failed freshness means the newest row is older than the limit.
When to use this skill
- A check or a subject shows
failedorerroredand the user wants to know why - The user wants to see the rows a check matched
- A materialized view's latest run shows an error that starts with
Not published: - A view kept serving old data after a refresh, and the data quality gate is on
- Another skill (
authoring-data-quality-checksorauditing-warehouse-view-health) found a failing check or a blocked view and handed it off
Available tools
| Tool | Purpose |
|---|---|
posthog:data-quality-check-results |
A check's recent runs, with compiled_query, error and the config it ran |
posthog:execute-sql |
Re-run a run's compiled_query to see the failing rows |
posthog:data-quality-check-run |
Run a check now |
posthog:data-quality-check-update |
Fix an assertion or change its severity |
view-get |
A view's definition and status |
view-run-history |
A view's materialization runs and their errors |
view-run |
Materialize a view again |
To find the failing checks, query system.information_schema.data_quality_checks for last_status IN ('failed', 'errored'), or system.information_schema.data_quality_health for a subject's verdict.
Workflow
Step 1: Read the run
Call posthog:data-quality-check-results for the check.
On the newest run, read:
statusanderrorcheck_configandcheck_severity: what the run asserted, which can differ from the check todaycompiled_query: HogQL that selects the failing rows. Forrow_countit returns the count instead, so judge that check byobserved_value.audited_staged_refresh: true when the run was part of a gated audit of a refresh before it was published. An errored run can carry it too, so readstatusfirst.
Retention clears compiled_query after 30 days.
For an older run, run the check again.
Step 2: Look at the failing rows
Run compiled_query with posthog:execute-sql.
An empty compiled_query means there is nothing to replay: retention cleared it, or a gated run could not read the view's definition.
Look at what it matched before you report anything.
A failure means one of two things: the data is bad, or the assertion is wrong.
The rows tell you which.
When audited_staged_refresh is true, the query does not read the published table.
It holds the view's definition in a WITH clause and reads the view's source tables now.
The sources may have changed since the run, so the rows and the count can differ from the run.
A query that now returns zero rows does not prove that the refresh was clean.
Compare with failed_row_count on the run.
Step 3: Read an errored run
An errored run did not judge the data. Match the error text:
| Error text | Cause and fix | | ---
Câu hỏi thường gặp
Errored nghĩa là gì?
Nghĩa là truy vấn kiểm tra không chạy được, nên không có gì được đánh giá. Vấn đề thường nằm ở thông báo lỗi, không nằm ở dữ liệu.
Vì sao kiểm tra số lượng dòng không hiển thị dòng thất bại nào?
Kiểm tra số lượng dòng so sánh số đếm quan sát được với giới hạn của nó, nên bạn đọc số đếm đó thay vì tìm các dòng khớp.
Not published đối với view nghĩa là gì?
Nghĩa là việc làm mới bị chặn vì cổng kiểm tra chất lượng dữ liệu chưa đạt, nên dữ liệu mới hơn chưa được xuất bản.
Chi tiết
Mô tả gốc của tác giả
Finds out why a data quality check failed or errored, looks at the rows it matched, and recommends the fix. Also covers a materialized view refresh that the data quality gate did not publish. Use when asked why a check is red, what rows failed, why a view shows "Not published", why a view's data is stale after a refresh, or how to get a blocked refresh published. Trigger terms: failed check, failing rows, errored check, data quality failure, not published, blocked materialization, unpublished refresh, check keeps failing.
repo: PostHog/posthog
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6855
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
depot-ci
41kGiúp agent của bạn thiết lập và chạy quy trình Depot CI, một lựa chọn thay thế GitHub Actions, gồm chuyển các quy trình hiện có và đọc nhật ký chạy.
depot-container-builds
41kGiúp agent của bạn build image Docker trên các builder từ xa của Depot, gồm image đa nền tảng, đẩy lên registry và sửa lỗi build.
depot-github-runners
41kGiúp agent của bạn chuyển các job GitHub Actions sang runner do Depot quản lý, chọn kích thước và nhãn runner, và xử lý lỗi thiết lập runner.
editing-agents-md
41kGiúp agent của bạn quyết định một quy tắc nên nằm trong file AGENTS.md hay CLAUDE.md, và viết sao cho quy tắc được tuân thủ mà file không bị phình to.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.