Add CI: validate committed data against schemas - #2
Merged
Conversation
Adds scripts/validate.py + a PR-gate workflow: checks each data/<datasource>/ folder — metadata.json against metadata.schema.json, and each parquet against its column schema (required columns, dtypes, primary-key uniqueness, method_id foreign-key integrity). Relaxes metadata.schema.json optional string fields to allow null (matches the existing scaffold metadata). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
This data-only repo had no CI. Adds a PR gate that validates every
data/<datasource>/against the repo schemas:metadata.json→schema/metadata.schema.json(JSON Schema)method.yaml/characterization-factor.yaml/normalization-weighting.yaml): required columns present, dtypes compatible,primary_keyunique, andforeign_keyintegrity (every CFmethod_idexists in the methods table).Also relaxes the optional string fields in
metadata.schema.jsonto allownull, matching the existing IPCC/ReCiPe scaffold metadata (which setlicense/retrieved/source_urlto null and previously wouldn't have validated).Should land before the EF 3.1 data PR (#1) so that import is gated by it.
🤖 Generated with Claude Code