authoring-data-quality-checks

Creates and runs dbt-test style data quality assertions on PostHog warehouse tables and views.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill authoring-data-quality-checks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authoring-data-quality-checks
Source: https://github.com/PostHog/posthog-foss/tree/main/products/data_quality/skills/authoring-data-quality-checks
Command: npx skills add https://github.com/PostHog/posthog-foss --skill authoring-data-quality-checks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Warehouse tables and saved-query views often contain nulls, duplicates, stale data, or broken foreign keys that silently corrupt downstream analysis. This Skill lets you define, run, and monitor data quality checks so you know whether a table is trustworthy before building on it.

Core Features & Use Cases

  • Assertion Authoring: Create not-null, uniqueness, accepted-values, referential-integrity, row-count, freshness, and custom HogQL checks on warehouse tables or saved-query views via MCP tools.
  • Run and Verify: Execute checks on demand, poll run results through system.information_schema views, and inspect compiled queries to see exactly which rows failed.
  • Health Judgment: Read per-subject health verdicts (failing, erroring, warn, healthy, unknown) to decide whether a table is safe to use in an analysis.
  • Use Case: Before trusting an orders table in a revenue report, add a not-null check on the join key, a uniqueness check on the order id, and a freshness check on the sync timestamp, then run them and review the results.

Quick Start

Add a not-null check and a uniqueness check to my orders warehouse table, run them, and tell me whether the table is healthy.

Frequently Asked Questions about authoring-data-quality-checks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add data quality checks to a warehouse table?

Use the data-quality-check-create-on-table or create-on-view MCP tool with the table or saved query ID, specifying a check type like not_null, unique, or freshness. Then run it once with the corresponding run tool and poll the results to verify it works.

What types of data quality checks are supported?

Supported check types are not_null, unique, relationships, accepted_values, freshness, row_count bounds, and custom_sql for arbitrary HogQL assertions. Each check passes when it finds zero failing rows, matching dbt test semantics.

How do I check if a table is trustworthy before using it?

Query system.information_schema.data_quality_health for the subject's verdict. A failing status means an error-severity check found bad data, healthy means checks passed, and unknown means no checks exist, which is not evidence of health.

Why did my data quality check return an errored status?

An errored result means the check query could not run at all, usually due to a column name typo or a subject that no longer exists. It is never a data problem, so fix the check configuration rather than investigating the data.

Can I update an existing check's assertion or column?

No, the assertion (type, column, config) and subject are immutable after creation. Create a corrected check and delete the old one instead; updates are only allowed for metadata, severity, and ownership.

When do data quality checks run automatically?

Checks run when their subject's data changes: materialized view checks run during refresh, source table checks run after each sync, and view checks run when their DAG runs. Views outside any DAG only run on demand.