Repository navigation
fix: validate against the data contract - #45
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac6abe5f78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| val perRecord = frame.toJSON.map { json => | ||
| decodeRow(json, rowDecoder).toList.flatMap(violationsOf).distinct | ||
| } |
There was a problem hiding this comment.
Treat undecodable Spark rows as validation failures
When DataDecoder[A] cannot decode Spark's frame.toJSON representation, converting the failed decode with .toList produces no messages, so the row is treated as contract-compliant without ever invoking violationsOf. This can occur whenever a decoder supports the original source encoding but not Spark's JSON object shape—for example, the default intDecoder parses a bare integer while a one-column Spark row is rendered as a JSON object. Because the later total count still includes these rows, a wholly undecodable frame can incorrectly return passed = true and score = 1.0; decoding failures need to be surfaced as violations or errors rather than mapped to an empty violation list.
Useful? React with 👍 / 👎.
validate ignored the contract and always passed. It now applies the contract to every record on both engines, over the Spark frame rather than the driver sample.