feat: violation row export with --show-violations#3
Closed
SpollaL wants to merge 1 commit into
Closed
Conversation
- Adds --show-violations [N] flag (default N=5) to fetch the first N failing rows per rule - JSON output gains a sample_rows array on each failing rule result (omitted when flag not used) - Table output gains a SAMPLE VIOLATIONS column showing compact JSON of violating rows - fetch_violation_samples() in runner.rs executes SELECT * for each check type and converts Arrow record batches to JSON - Custom check returns empty samples - 10 new tests covering all check types, limit behavior, no-violation case, and custom check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
Merged manually into master via rebase. |
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
--show-violations [N]CLI flag that fetches and attaches the first N violating rows to each failed rule result (default N=5 when flag given without value)sample_rowsarray on each failing rule result (field omitted when flag not used)Example (JSON mode)
{"name":"price_not_negative","status":"fail","violations":3,"total_rows":1000,"violation_rate":0.003,"sample_rows":[{"price":-5.0},{"price":-0.01},{"price":-0.5}]} {"name":"id_not_null","status":"pass","violations":0,"total_rows":1000,"violation_rate":0.0}Test plan
test_fetch_samples_not_null— null rows returned for NotNull checktest_fetch_samples_min— rows below min returnedtest_fetch_samples_max— rows above max returnedtest_fetch_samples_between— out-of-range rows returnedtest_fetch_samples_not_empty— empty-string rows returnedtest_fetch_samples_unique— duplicate rows returnedtest_fetch_samples_regex— non-matching rows returnedtest_fetch_samples_limit— only N rows returned when more violations existtest_fetch_samples_no_violations— empty vec when no violationstest_fetch_samples_custom_returns_empty— Custom check returns empty vec🤖 Generated with Claude Code