Skip to content

Word validation errors from the catalog too - #113

Merged
arav-agarwal2 merged 1 commit into
mainfrom
feat/message-catalog
Oct 7, 2026
Merged

arav-agarwal2 merged 1 commit into
mainfrom
feat/message-catalog

Conversation

@arav-agarwal2

Copy link
Copy Markdown
Collaborator

Pydantic validation failures reached the report as Pydantic's own text: its built-in messages ("Field required"), and our validators' hand-written ValueErrors behind a "Value error," prefix, located at "(top level)" when a model-level validator failed. None of it was in the catalog.

  • Validators raise messages.Invalid(rule, key, **values), a ValueError rendered from the catalog; the loaders report it at the field that failed, keeping its fix and spec. compute_regions raises it too.
  • A _pydantic catalog section words Pydantic's built-in errors by error type, using the error's context values and {input}.
  • Tests: Invalid calls are checked like err() calls; no bare ValueError may be raised under models/; the _pydantic entries must match exactly the error types the file models' schemas can produce; and bad files through each loader render entirely from the catalog in strict mode.

Pydantic validation failures reached the report as Pydantic's own text: its
built-in messages ("Field required"), and our validators' hand-written
ValueErrors behind a "Value error," prefix, located at "(top level)" when a
model-level validator failed. None of it was in the catalog.

- Validators raise messages.Invalid(rule, key, **values), a ValueError
  rendered from the catalog; the loaders report it at the field that failed,
  keeping its fix and spec. compute_regions raises it too.
- A _pydantic catalog section words Pydantic's built-in errors by error type,
  using the error's context values and {input}.
- Tests: Invalid calls are checked like err() calls; no bare ValueError may be
  raised under models/; the _pydantic entries must match exactly the error
  types the file models' schemas can produce; and bad files through each
  loader render entirely from the catalog in strict mode.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@arav-agarwal2
arav-agarwal2 merged commit e06bff1 into main Oct 7, 2026
7 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