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>
A schema with the custom property `propertyOrder: strict` gets a check that the columns of the data are in the order of its properties. A missing column is left to the presence check and an undeclared one to `additionalProperties: false`, so the two together pin a file to exactly the declared columns, in order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #1723.
Builds on #1725: the first commit is that PR, and this PR's own change is the last commit. Once #1725 is merged I'll rebase, and the diff shrinks to that commit.
Problem
A contract cannot say that the columns of a file must be in the declared order. Swapped columns pass unnoticed, and in a CSV file without a reliable header that hides a real error. ODCS v3.2.0 has no field for this.
What this changes
A schema opts in with a custom property:
model_property_order, dimension conformity). It fails with the expected and the actual order:Fields in another order: expected order_id, quantity, amount; found order_id, amount, quantity, withexpected_orderandactual_orderin the diagnostics.additionalProperties: falsefrom Fail on columns the contract does not declare, when the schema says so #1725. So the two settings together pin a file to exactly the declared columns, in order. They are separate because some exchanges care about the set of columns but not their order.--metadata-only, and works on every server read through ibis.Tests
tests/test_test_property_order.py: 9 tests, covering the declared order, another order, a missing column, an extra column, case, no custom property, both settings together,--metadata-only, and a JSON file.uv run pytest: all pass.ruff: clean.Docs
schema.md: a row in the checks table and a section on the setting. CHANGELOG entry under Added.uv run pytest)uv run ruff check --fix && uv run ruff format)🤖 Generated with Claude Code