docs/managed-datahub/observe/data-contract.md
A Data Contract is an agreement between a data asset's producer and consumer, serving as a promise about the quality of the data. It often includes assertions about the data’s schema, freshness, and data quality.
Some of the key characteristics of a Data Contract are:
Below is a screenshot of the Data Contracts UI in DataHub.
<p align="center"> </p>Another way to word our vision of data contracts is A bundle of verifiable assertions on physical data assets representing a public producer commitment. These can be all the assertions on an asset or only the subset you want publicly promised to consumers. Data Contracts allow you to promote a selected group of your assertions as a public promise: if this subset of assertions is not met, the Data Contract is failing.
See docs on assertions for more details on the types of assertions and how to create and run them.
:::note Ownership The owner of the physical data asset is also the owner of the contract and can accept proposed changes and make changes themselves to the contract. :::
Data Contracts can be created via DataHub API, or UI.
:::note Create Data Contracts via UI When creating a Data Contract via UI, the Freshness, Schema, and Data Quality assertions must be created first. :::
API guide on creating data contract is coming soon!
Running Data Contracts is dependent on running the contract’s assertions and getting the results on DataHub. Using DataHub Cloud Observe (available on SAAS), you can schedule assertions on DataHub itself. Otherwise, you can run your assertions outside of DataHub and have the results published back to DataHub.
DataHub integrates nicely with DBT Test and Great Expectations, as described below. For other 3rd party assertion runners, you’ll need to use our APIs to publish the assertion results back to our platform.
During DBT Ingestion, we pick up the dbt run_results file, which contains the dbt test run results, and translate it into assertion runs. See details here.
For Great Expectations, you can integrate the DataHubValidationAction directly into your Great Expectations Checkpoint in order to have the assertion (aka. expectation) results to DataHub. See the guide here.
<p align="center"> </p>