मुख्य सामग्री पर जाएँ
Skillpedia
डेटाबेस41k · #6854

authoring-data-quality-checks

यह क्या करती है

यह स्किल आपकी डेटा टेबल और व्यू में स्वचालित टेस्ट जोड़ती है, जैसे यह जाँचना कि कोई कॉलम कभी खाली न हो। यह उन लोगों के लिए है जो खराब डेटा को रिपोर्ट तक पहुँचने से पहले पकड़ना चाहते हैं।

कब इस्तेमाल करें

  • ✓जब आप किसी टेबल या व्यू में खाली मान, डुप्लिकेट या गायब संदर्भ जाँचना चाहें।
  • ✓जब आपको यह पुष्टि करनी हो कि कोई टेबल तय समय के भीतर ताज़ा हुई है।
  • ✓जब आप किसी व्यावसायिक नियम के लिए HogQL में लिखी कस्टम जाँच जोड़ना चाहें।

Skill का लिंक

https://github.com/PostHog/posthog/blob/master/products/data_quality/skills/authoring-data-quality-checks/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/PostHog/posthog/blob/master/products/data_quality/skills/authoring-data-quality-checks/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“कृपया जाँच जोड़िए, ताकि मेरी orders टेबल में किसी भी ऑर्डर का customer ID खाली न हो।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

हर जाँच एक छोटा दावा है जो विफल होने वाली पंक्तियाँ गिनता है। जब कोई न मिले तो वह पास होता है, dbt टेस्ट की तरह। सिर्फ़ गिनती और क्वेरी सहेजी जाती हैं।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Authoring data quality checks

A check is one assertion about one warehouse table, view, or HogQL catalog metric. It compiles to a count-only HogQL query and passes when it finds zero failing rows, like dbt test. Failing rows are never stored; only counts and the compiled query are, so to see the offending rows you re-run the stored query yourself.

row_count is the exception. It passes when the observed count is within its configured min/max bounds, so its failed_row_count comes back null and its stored query returns that single count, not offending rows. Read the observed count to judge it rather than looking for matched rows.

Reads go through SQL (system.information_schema.data_quality_*); writes and runs go through the data-quality MCP tools.

Before you write anything: look

Two queries save you from the two most common mistakes — duplicating a check, and checking a column that doesn't exist.

-- What is already covered?
SELECT name, subject_name, column_name, check_type, config, severity, last_status
FROM system.information_schema.data_quality_checks
WHERE subject_name = 'orders'

-- What columns are there, and what do they mean?
SELECT column_name, data_type, description
FROM system.information_schema.columns
WHERE table_name = 'orders'

Re-creating a byte-identical check is a harmless no-op — checks are keyed by a fingerprint of the subject, type, column, and config, so an identical create upserts. A near-duplicate is not harmless: it doubles the noise for whoever reads the results. If an existing check's assertion is close but wrong, edit the existing check. Updates preserve its identity and history; the subject stays fixed by the URL. An edit that duplicates another check's assertion is rejected.

Choosing checks

Aim for a handful that would actually catch a real regression, not blanket coverage. A model with twenty checks nobody reads is worse than three that fail meaningfully.

Reach for these first, in roughly this order:

  • not_null on the columns downstream joins and filters depend on. The single highest-value check. A null join key silently drops rows.
  • unique on whatever the model claims is its grain. If orders is one row per order, say so.
  • relationships on foreign keys. Catches the join that quietly stopped matching after an upstream change.
  • accepted_values on status and category columns whose downstream logic branches on them.
  • freshness on the timestamp column of anything that syncs. Catches a dead pipeline, which no row-level check will.
  • row_count bounds when you know the plausible range. Good for catching a truncated sync.
  • custom_sql only when nothing above expresses the invariant — e.g. cross-column arithmetic (select 1 from orders where total != subtotal + tax). Every row it returns counts as a failure.

Call posthog:data-quality-check-types for each type's exact config schema rather than guessing.

One tool set covers every kind of subject. Call posthog:data-quality-subjects for the tables, views and metrics you can read, then pass the subject_type and id it gives you as subject_type and subject_uuid in posthog:data-quality-check-create. Only a subject marked editable can carry a check; the others can still be the target of a relationships check. After that a check is addressed by its own id: -update, -delete, -run and -results take no subject.

Checks on PostHog tables

events, persons and groups take checks like any other subject: pass subject_type: "posthog_table" with the id posthog:data-quality-subjects gives you. Every check type works on them, and relationships can point at one as its target too.

These tables are large, so consider lookback_hours before you author a check on one. It bounds the rows the check reads by the table's own time column: timestamp on events, and created_at on persons and groups, which is when each was first seen rather than when it last changed. Without it the check reads the whole table, which is allowed and sometimes what you want -- an unbounded unique on events.uuid says something a windowed one cannot. A check that runs out of ClickHouse's execution budget reports errored with the message; adding a window is usually the fix.

On a relationships check, lookback_hours bounds the rows it checks and to_lookback_hours bounds the rows it looks for a match among. Set the second one carefully: a narrow t

अक्सर पूछे जाने वाले सवाल

क्या खराब पंक्तियाँ कहीं सहेजी जाती हैं?

नहीं। केवल गिनती और कंपाइल की गई क्वेरी सहेजी जाती हैं, इसलिए दोषपूर्ण पंक्तियाँ देखने के लिए आप क्वेरी खुद दोबारा चलाते हैं।

क्या यह डुप्लिकेट जाँच बनाएगी?

स्किल पहले मौजूदा जाँचें देखती है, और एक ही जाँच दोबारा बनाने से कोई नुकसान नहीं होता।

पंक्ति गिनती की जाँच क्या करती है?

यह पास होती है जब पंक्तियों की गिनती आपके तय न्यूनतम और अधिकतम दायरे में हो।

जानकारी

लेखक का मूल विवरण

Adds and runs data quality checks (dbt-test style assertions) on a project's warehouse tables and saved-query views, and HogQL catalog metrics: not-null, uniqueness, accepted values, referential integrity, row-count bounds, freshness, and custom HogQL. Metrics support custom SQL checks only. Use when asked to test a model, validate a view, check for nulls or duplicates, add data quality checks, find out why a number looks wrong, or judge whether a warehouse table is trustworthy before using it in an analysis. To describe what data *means* (metrics, certifications, joins), see setting-up-data-c

repo: PostHog/posthog

लोकप्रियता

GitHub स्टार
41k
रैंकिंग में स्थान
#6854
लाइसेंस
—
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

depot-ci

41k

यह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

depot-container-builds

41k

यह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

depot-github-runners

41k

यह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

editing-agents-md

41k

यह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।

AI और एजेंटएजेंट

मिलती-जुलती skills