Data Contract to Data Product: Validate and Diff in Python
Version 1.3.0 removed a column and changed a type. The check said it needs 2.0.0.
Video #211 ยท Data governance
Steps in the video
Files
- product_v1.yaml (10 lines)
- product_v2.yaml (11 lines)
- run.py (16 lines)
- validate.py (40 lines)
Tested with
Python 3.12.15 | PyYAML==6.0.3
What this does not show
Made-up product in my own small format, not the Open Data Contract Standard; the check compares only column names and types, and it prints its findings without failing a build.
Sources
- https://bitol-io.github.io/open-data-contract-standard/latest/changelog
- https://dev.to/gowthampotureddi/data-contracts-open-data-contract-standard-schema-registry-producer-consumer-slas-1dj9
- https://docs.rs/crate/odcs/0.9.1/source/docs/user/compatibility.md
- https://etlantic.readthedocs.io/en/latest/03_DATA_CONTRACTS/VERSIONING/
Learning IT by Example.