release 0.1.3: validate warns-not-raises; schema_hash prefix match#12
Merged
Conversation
β¦h prefix match Two paired changes to make rebuilds resilient against benign upstream drift while keeping CI-grade strictness one flag away: 1. expect.schema_hash now matches as a prefix when the manifest value is shorter than the full 64-char SHA-256. All 37 slugs with schema_hash set use the 12-char short form (matching the [validate] print line convention); the previous full-string equality silently broke every one of them on rebuild. Equal-length values still compare strictly, so full hashes remain enforceable for callers that prefer them. 2. The validate stage now treats row/schema_hash drift as a [WARN] line on stderr and continues by default. The previous behaviour (raise AssertionError) turned every HF Arrow-conversion bump or grow-only row change into a failed build for users who had already opted into "fetch whatever is upstream now". The new --strict flag on scripts.pipeline.build re-enables hard failures for CI / pre-release gates. The old --loose flag is removed (its behaviour is now the default). Discovered via the wikipedia-en rebuild, which produced a parquet that matched expect.rows exactly and matched the 12-char schema_hash prefix exactly, yet failed validate because full-string equality could never hold between 12 and 64 chars. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: mprammer <martin@spiraldb.com>
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.
Summary
Two paired changes to the validate stage so rebuilds aren't bricked by benign upstream drift, while keeping CI-grade strictness one flag away.
1.
expect.schema_hashis now prefix-matchedAll 37 slugs in
sources.jsonwithexpect.schema_hashset use the 12-char short form (matching the[validate] schema_hash=print convention β same idea as git short SHAs). The previous full-string equality made every one of them fail validation on rebuild, because_schema_hashreturns 64 hex chars.validate.pynow uses strict equality when expected and actual are the same length, and prefix match when expected is shorter.2. Validate-stage drift warns by default;
--strictto failA row count or schema hash mismatch now emits a
[WARN]line to stderr and the build continues. Users invokingpython -m scripts.pipeline.build <slug>have already opted into "fetch whatever is upstream now"; an HF Arrow-conversion bump or a grow-only row count change shouldn't turn that into a failed build.The new
--strictflag onscripts.pipeline.buildupgrades those warnings to hard errors β recommended for CI / pre-release gates. The previous--looseflag (which was the inverse) is removed; its behaviour is now the default.How this surfaced
The
wikipedia-enrebuild produced a parquet that matchedexpect.rowsexactly (6,407,814) and matched the 12-char schema_hash prefix exactly, yet failed validate because full-string equality between 12 and 64 chars can never hold. Diagnosing that revealed the convention/code mismatch affected all 37 slugs withschema_hashset.Files
scripts/pipeline/validate.pyβ prefix-match helper, warn-vs-strict semantics,strict=Falsedefault.scripts/pipeline/build.pyβ--looseβ--strictflag flip, updated docstring + example.sources.schema.mdβ documents both the prefix-match rule and the new warn-default semantics for theexpectblock.pyproject.toml+CHANGELOG.mdβ version bump to 0.1.3.π€ Generated with Claude Code