LakeLogic
Loading…
Back to Blog
Data Contracts

Data Contracts Explained: What ODCS Standardises and What Still Has to Run

Feb 10, 2026
LakeLogic Team
Data Contracts Explained: What ODCS Standardises and What Still Has to Run

Picture a source team that renames customer_id to cust_id in the customers table. Their release notes mention it, but the team that owns the churn model does not read them. On the next run the churn model scores every customer as new, and the analyst who notices has to trace which upstream change caused it. Everyone involved did their job. There was simply no agreement anyone could check.

That is the gap a data contract fills. Producers and consumers already have expectations about a table: which columns exist, what they mean, how fresh the data is, who to call. In a common pattern, those expectations live in wikis, chat threads and the heads of a few senior engineers. A contract writes them down in a form tools can read, so a change that breaks them is caught by a check instead of by a dashboard.

The short answer: a data contract is a versioned, machine-readable agreement about a dataset. The Open Data Contract Standard (ODCS) gives that agreement a common, vendor-neutral format. Describing the agreement is half the job; the other half is checking real data against it, as early as possible. This post explains what ODCS covers, the realistic ways teams enforce contracts, and how LakeLogic's executable contracts relate to ODCS, without claiming more than they do.

Why expectations break silently

  • The agreement is prose. A wiki page cannot fail a build. When the schema changes, the page goes stale and nothing notices.
  • The producer cannot see the consumers. The team renaming a column rarely knows which models, reports or agents read it.
  • Checks run late. Raw data usually lands as-is; if the first check runs on the finished report, the bad data has already been joined, aggregated and shared. The earliest cheap place to stop a bad record is when it is cleaned into the first trusted layer. That is what "shift left" means for data.

What ODCS covers

The Open Data Contract Standard is an open YAML specification maintained by the Bitol project under the LF AI & Data Foundation, released under Apache 2.0. Its current major version is v3. A contract document can describe:

  • Fundamentals and schema: the dataset, its objects and properties, types and descriptions.
  • Data quality: expectations at property and object level.
  • Service levels: freshness, availability and similar commitments.
  • Team, roles and support: who owns it, who may access it, where to ask.
  • Servers, pricing, tags and authoritative definitions: where the data lives, what it costs, and links to business definitions.

Its strength is neutrality. The same document can feed a catalog, a governance review and several tools, whether the data sits in Databricks, Snowflake or an open-source stack. ODCS standardises the agreement; it does not run your pipeline. Something still has to read the data and compare it with the contract.

The ways teams enforce contracts today

ApproachHow it worksGood fitWatch out for
Contract as documentation (ODCS file, catalog entry)Agreement published, reviewed, read by catalogsAgreeing terms across teamsNothing fails unless another tool checks it
dbt model contractsNames and types checked at buildTransformation in dbtEnforced constraints vary by platform
Databricks pipeline expectationsWarn, drop rows or fail the updateLakeflow declarative pipelinesRules live in pipeline code
Validation tools (Great Expectations, Soda)Checks run against a dataset; report or failBroad checks across warehousesA second definition that can drift
Schema registry (event streams)Blocks messages that break the schemaKafka and other event pipelinesStructure only, not business rules

For dbt, which constraints the platform actually enforces depends on the warehouse; content checks beyond those are data tests that run after the build. Databricks expectations and validation tools are capable, but their rules sit beside the agreement document rather than in it.

All of these can work, and a mature estate often uses two or three. The open question is how the agreement and the enforcement stay the same thing. When the contract lives in one file and the checks in another, they drift exactly the way the wiki did.

How LakeLogic relates to ODCS

LakeLogic contracts follow the Open Lakehouse Contract (OLC), an open specification for the executable side of a data product on a lakehouse: SQL row and dataset rules, transformations, materialization (merge, append, overwrite), table format and engine. The LakeLogic runtime reads the contract and runs it: it validates rows, sends failures to quarantine with the failing rule attached, and writes the clean result.

The OLC documentation describes the relationship as complementary: ODCS standardises the agreement; OLC standardises the execution. Where both cover a concern (schema, quality, service levels), ODCS declares it and OLC turns it into checks that run.

They connect through conversion, not a shared file:

from lakelogic.core.models import DataContract

contract = DataContract.from_yaml("orders.odcs.yaml")  # an ODCS v3 document is converted on load
# ... run it: validate, quarantine, materialize ...
odcs = contract.to_odcs()  # write ODCS back out

There is also a lakelogic export-odcs command. An ODCS document is recognised by kind: DataContract and an apiVersion; its quality expectations are mapped to LakeLogic row and dataset rules, and ODCS field names are accepted as aliases. A way for an OLC contract to point directly at its ODCS agreement, instead of converting, is proposed in the OLC documentation but not part of the current schema.

What that means in practice: a team can keep ODCS as the agreement it publishes and reviews, and run it through LakeLogic. It does not mean every ODCS property has a runtime effect. Pricing, roles and support channels are carried as metadata; they are not enforced.

A worked example

In the RideFlow reference project (a fictional ride-hailing business), a Silver contract for driver profiles declares, among others:

quality:
  row_rules:
  - name: driver_id_not_null
    sql: driver_id IS NOT NULL
    category: completeness
  - name: rating_range_max
    sql: rating IS NULL OR rating <= 5
    category: validity

When a profile arrives without a driver_id, it does not reach the Silver table. It lands in the domain's quarantine table with [pre] Rule failed: driver_id_not_null (driver_id IS NOT NULL) on the row. The same rule that documents the expectation is the one that enforced it. Our post on inline data quality gates shows that quarantine table and the batch-level checks that sit beside it.

When you might not need this

  • One team owns producer and consumer. If the people who change the schema also maintain the reports, a good test suite may be all the contract you need.
  • You only need an agreement for a catalog. Publishing ODCS documents with no runtime may be enough for discovery and governance sign-off.
  • Your enforcement already lives in one tool (dbt contracts and tests, or pipeline expectations) and the team keeps it current. Adding a second contract format adds work.

An executable contract pays off when many teams produce and consume shared tables, and the agreement must be both readable by people and enforced on every run.

Limits worth knowing

  • A contract is only as good as its rules. Data can pass every declared check and still be wrong in a way nobody wrote down.
  • A declared owner is not accepted accountability. The contract records who should answer; it does not make them answer.
  • Conversion is a mapping, not identity. Round-tripping ODCS through LakeLogic preserves what both sides can express; check unusual quality definitions after import.
  • Standards move. ODCS versions evolve; check which apiVersion your tools read and write.

Key takeaways

  1. A data contract is a versioned, machine-readable agreement about a dataset; its value comes from checks that read it.
  2. ODCS gives the agreement a vendor-neutral format covering schema, quality, service levels, ownership and more.
  3. Enforce as early as possible: the first cleaned layer is the cheapest place to stop a bad record.
  4. Keep the agreement and the enforcement in one definition, or connected by conversion, so they cannot drift apart.
  5. Be clear which parts of a contract are enforced and which are metadata.

Try it

Write and run your first contract with the five-minute data contract quickstart. It runs in Google Colab with no setup.

See LakeLogic in action.