feat: add check-data-quality skill (DataHub assertions before writing SQL) - #96
Open
optimizedwf wants to merge 2 commits into
Open
feat: add check-data-quality skill (DataHub assertions before writing SQL)#96optimizedwf wants to merge 2 commits into
optimizedwf wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
check_data_qualityskill 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.
get_dataset_assertions(urn=...)for each candidate table.FRESHNESSvsVOLUME/FIELDfailures and maps each to the right query shape (e.g.julianday(max(raw)) - julianday(max(mart))for staleness;WHERE amount < 0for planted-bug counts)./improve-contextwhen 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).