Skip to content

fix: validate against the data contract - #45

Merged
vim89 merged 3 commits into
mainfrom
fix/validate-against-contract
Oct 6, 2026
Merged

vim89 merged 3 commits into
mainfrom
fix/validate-against-contract

Conversation

@vim89

@vim89 vim89 commented Oct 6, 2026

Copy link
Copy Markdown
Owner

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T09:44:31.173297Z ac6abe5 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +111 to +113
val perRecord = frame.toJSON.map { json =>
decodeRow(json, rowDecoder).toList.flatMap(violationsOf).distinct
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@vim89
vim89 merged commit 325b745 into main Oct 6, 2026
14 checks passed
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.

1 participant