Repository navigation
Conversation
A schema with the custom property `additionalProperties: false` (the JSON Schema term; ODCS has no field for it) gets a check that fails on fields of the data the schema does not declare, and names them. It reads only the column names, so it runs on every server read through ibis, also with --metadata-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
This branch has not been deployed
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.
Fixes #1722.
Problem
A contract cannot say that a file must have no columns besides the ones it declares. An extra column passes unnoticed. ODCS v3.2.0 has no field for this.
What this changes
A schema opts in with a custom property, named after the same idea in JSON Schema:
model_no_additional_fields, dimension conformity). It fails on columns the schema does not declare and names them:Fields not in the contract: note, withadditional_fieldsin the diagnostics.--metadata-only. On a CSV file it reads the{model}__raw__view; elsewhere the table itself.falseor the text"false".Tests
tests/test_test_additional_fields.py: 9 tests, covering an extra column, exactly the declared columns, case, no custom property, text values, a JSON file,--metadata-only, and a DuckDB database table.uv run pytest: all pass.ruff: clean.Docs
schema.md: a row in the checks table and a short section on the setting. CHANGELOG entry under Added.Note
This PR and #1724 touch a comment in
check_spec.pyand the same bullet inschema.md, so the one merged second needs a small rebase. I'll do that.uv run pytest)uv run ruff check --fix && uv run ruff format)🤖 Generated with Claude Code