feat: assert every node has an id and every edge has subject, predicate, and object in final graph QC - #107
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
The
--qcstage-7 study pass now asserts the core KGX join slots outright: every node must carry a non-emptyid, and every edge must carry non-emptysubject,predicate, andobject— completing the required-slot ladder begun by #106'sunnamed-nodes.Study assertions (
src/tablassert/study.py)unidentified-nodes: a node record whoseidkey is missing,null, or strips to empty fails the study. Since the id is exactly what's absent, examples key on the node'sname(or<no name>), making the offender identifiable from the stderr summary.incomplete-edges: an edge record missing any of the three core slots — missing key,null, or strips-to-empty — fails, counted per slot (e.g.predicate (2)), matching thewhitespace-valuesexample format.namealready asserted by feat: assert no unnamed nodes and no null or empty values in final graph QC #106'sunnamed-nodes; that check is untouched. A record with neither id nor name deliberately fires both assertions (pinned by test).Design
strip_nulls(rust/src/json.rs) deletes a null slot outright rather than emitting it, so on pipeline output a hit means the slot was null upstream and the record shipped broken — exactly the condition these assertions exist to catch loudly.Docs
docs/cli.md(--qcrow), thebuild_kgdocstring insrc/tablassert/cli.py(rendered by--help), andCHANGELOG.md(Unreleased).Testing
uv run --no-sync pytest -q --no-cov→1056 passed, 15 skippeduv run --no-sync pytest tests/test_study.py --no-cov -q→28 passeduv run --no-sync ruff check+ruff format --check→ clean;uv run --no-sync pyrighton changed files →0 errors