Schema Contract
2 probes
Validates dataset schemas against a declared YAML contract and detects
schema drift over time. Contracts specify column names, data types,
nullable flags, and ordering. Drift detection compares the live schema
against the last known baseline and emits CheckResult alerts for
added, removed, or type-changed columns.
Configuration
sources:
- type: schema_contract
dataset_path: /data/curated/orders.parquet
contract: /etc/metapod/contracts/orders.yaml
fail_on_drift: true
Contract file example:
# /etc/metapod/contracts/orders.yaml
dataset: orders
columns:
- name: order_id
type: int64
nullable: false
- name: customer_email
type: string
nullable: true
- name: amount
type: float64
nullable: false
Probes
Probe |
Description |
|---|---|
|
Validate live schema against YAML contract (missing/extra/mistyped columns) |
|
Detect schema drift vs. last recorded baseline |
Usage
metapod run "schema_contract.quality.*" --config config.yaml
Output
{
"probe": "schema_contract.quality.validate",
"source": "schema_contract",
"collected_at": "2026-03-31T08:00:00Z",
"results": [
{
"dataset": "orders.parquet",
"contract": "orders.yaml",
"status": "fail",
"violations": [
{
"column": "amount",
"expected_type": "float64",
"actual_type": "string",
"issue": "type_mismatch"
}
]
}
]
}