Skip to content

feat: add check-data-quality skill (DataHub assertions before writing SQL) - #96

Open
optimizedwf wants to merge 2 commits into
datahub-project:mainfrom
optimizedwf:feat/check-data-quality
Open

feat: add check-data-quality skill (DataHub assertions before writing SQL)#96
optimizedwf wants to merge 2 commits into
datahub-project:mainfrom
optimizedwf:feat/check-data-quality

Conversation

@optimizedwf

Copy link
Copy Markdown

Summary

Adds a check_data_quality skill that surfaces DataHub assertions (freshness / volume / field) before the agent writes SQL — so it can reason about stale or planted-bug data instead of blindly trusting a table that is known to lag its source.

This closes the gap that the existing skills (search-business-context, publish-analysis, save-correction, improve-context) don't cover: reading data-quality / freshness signals off the graph.

Why

A metadata-aware agent should not answer "how many billing records have a negative amount?" or "how stale is this mart?" without first checking whether the table carries a FAILING freshness / quality assertion. The skill makes that a first-class, reusable step.

  • Calls get_dataset_assertions(urn=...) for each candidate table.
  • Distinguishes FRESHNESS vs VOLUME/FIELD failures and maps each to the right query shape (e.g. julianday(max(raw)) - julianday(max(mart)) for staleness; WHERE amount < 0 for planted-bug counts).
  • Cites the assertion it used in the final answer, and suggests /improve-context when assertions are missing.

Verification

Validated during the DataHub 2026 hackathon against a real DataHub instance (lineage + assertions + Insight write-back), where reading the graph improved answer accuracy by +0.25 paired (metadata 0.95 vs plain 0.70 over 20 questions).

optimizedwf and others added 2 commits August 6, 2026 01:33
The SKILL.md alone was a no-op: the loader/graph inject a fixed set of
skill sections, and check-data-quality was registered nowhere, so its
instructions never reached the system prompt.

Register it as an always-on, instruction-only skill (the improve-context /
search-business-context pattern): add get_check_data_quality_prompt_section()
and inject it in both the default (build_system_prompt) and override
(graph.py) prompt paths. No new tool needed — get_dataset_assertions is
already a native DataHub tool from datahub_agent_context.

Tests: skill body reaches the system prompt; and a mocked assertions
response confirms get_dataset_assertions surfaces the type/latestResultType/
description fields the skill instructs the agent to read.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants