Add data-quality checks, contracts, and CI for core datasets#5
Open
bdevierno1 wants to merge 1 commit into
Open
Add data-quality checks, contracts, and CI for core datasets#5bdevierno1 wants to merge 1 commit into
bdevierno1 wants to merge 1 commit into
Conversation
- backend/data_quality/checks.py — four-dimension check primitives (completeness <0.5% null, validity allowed-values + non-negative, uniqueness zero-dup PK, freshness ≤ Tier-1 SLA 3600 s) - backend/data_quality/contracts/ — YAML data contracts for `operations` and `billing_sessions` (owner, schema, quality rules, SLAs) - backend/data_quality/runner.py — CLI that loads contracts, runs all checks, exits 1 on any failure (DATABASE_URL-aware) - backend/tests/test_data_quality.py — 14 unit tests covering all pass/fail paths per dimension + contract schema smoke-test - .github/workflows/data-quality.yml — CI: contract YAML lint, DQ unit tests, full backend suite on every push/PR - backend/requirements.txt — add pyyaml>=6.0.0 Co-Authored-By: Vecna <noreply@vecna.ai>
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.
What
Adds automated data-quality enforcement for the two core datasets
(
operations,billing_sessions) across four dimensions from ourData Quality Dimensions policy, with YAML data contracts and a GitHub
Actions CI job that gates every push.
New files:
backend/data_quality/checks.pybackend/data_quality/runner.pybackend/data_quality/contracts/operations.yamloperationstablebackend/data_quality/contracts/billing_sessions.yamlbilling_sessionstablebackend/tests/test_data_quality.py.github/workflows/data-quality.ymlWhy
No automated enforcement of the six quality dimensions means regressions
(null floods, bad status values, stale rows) only surface in production.
This wires checks into CI so failures block merge, and the data contracts
codify the producer's promises for consumers.
Check dimensions
MAX(updated_at)ageHow to verify
The
.github/workflows/data-quality.ymljob runs all three steps aboveon every push/PR. Check the Actions tab after this PR merges.
Rollback
Delete or disable
.github/workflows/data-quality.ymlto remove the CIgate. The
data_quality/module has no runtime coupling to the application(it is not imported by FastAPI routes) — removing it is a pure file delete.
Out of scope
🤖 Generated with Vecna
Co-Authored-By: Vecna noreply@vecna.ai