Data contracts and data quality tools are often treated as the same thing, but they solve different problems at different moments, and the strongest setups use both. A data quality tool checks whether data that already exists meets expectations. A data contract defines and enforces the agreement about what a dataset should be, before it is produced. Bauplan is the execution layer for AI-generated data changes: it enforces contracts at compile time and gates publication with a Write-Audit-Publish merge, and it can run your quality checks inside that gate.
Data quality tools validate data that exists. Great Expectations runs expectation suites against a batch, Soda runs checks on tables, and Monte Carlo monitors production for anomalies. They are expressive and valuable, and they are how most teams verify content: nulls, ranges, distributions, freshness, referential integrity.
The defining trait is timing. These tools operate on data that has already been produced, so a failure tells you something is wrong with data that exists, and depending on wiring, may already be in production. That is the right model for content correctness, because you often cannot know a value is out of range until you have computed it. It is detection and verification of produced data, not a guarantee about data before it is produced.
A data contract is an agreement. It states what a dataset must look like, its schema, types, and structural guarantees, so the team producing the data and the teams consuming it share an explicit, enforceable expectation. The contract exists before the data is produced and governs whether a change is allowed to produce data that breaks the agreement.
The value is in enforcement and in the agreement itself. A contract gives consumers something stable to build on, and it gives producers a clear boundary they cannot cross without it being caught. Where a quality check asks "is this value acceptable," a contract asks "does this change honor the shape everyone agreed on," and it is enforced at the point a change is made, not after the data is scanned.
Bauplan enforces both halves, at the two moments each belongs to. The contract, the schema agreement, is enforced at compile time: Bauplan checks it when it builds the run graph, so a change that would break the agreed schema fails before it runs. Content quality is enforced at execution time, in the audit step of the Write-Audit-Publish flow: the run happens on an isolated branch, quality checks run against the output, and the branch merges to production only if they pass.
So the contract governs the shape before execution, and the quality checks verify the content before publication, and neither depends on the change reaching production first. You can run your existing Great Expectations or Soda checks as the audit, keeping the quality tools you trust while the contract and the merge gate add the guarantees they do not provide on their own.
Use a data contract when the risk is structural: an upstream change altering schema, a producer breaking consumers, a hand-off between teams that needs a stable agreement. Contracts prevent the "someone changed the shape and everything downstream broke" failure.
Use a data quality tool when the risk is content: values out of range, unexpected nulls, broken joins, drift over time. Quality checks catch the "the shape is fine but the numbers are wrong" failure.
Use both, gated when the data is going to production and correctness matters. The contract agrees and enforces the shape, the quality checks verify the content, and a merge gate makes publication conditional on both, so nothing that violates either reaches consumers. In Bauplan, that is the default flow: compile-time contract, audited quality checks, atomic merge.
Neither alone; they cover different failures. Data contracts prevent structural problems by enforcing the agreed schema before a change is produced. Data quality tools catch content problems by checking values, ranges, and distributions on data that exists. Reliable data needs both: a contract so the shape cannot silently break, and quality checks so the content is verified. Bauplan enforces the contract at compile time and runs quality checks in a merge-gated audit, so the two work together rather than as an either/or.
Great Expectations is a data quality tool, not a contract system, though the line can blur. It excels at runtime expectations on data that exists, and you can encode some schema expectations in it, but it validates after data is produced rather than enforcing an agreement before a change runs, and it does not by itself gate publication. In Bauplan you can run Great Expectations as the audit step, which pairs its expressive content checks with a compile-time contract and a merge gate, giving you the enforcement a quality tool alone does not provide.
A data quality check validates a property of data, such as a range or null rule, usually at runtime after the data exists. A data contract is the broader, enforced agreement about a dataset's schema and structure between producers and consumers, applied before or as a change is made. Quality checks verify content; contracts govern shape. In Bauplan, contracts are enforced at compile time and quality checks run in the audit before merge, so both are enforced at the right moment.