Skip to main content

Create a Data Contract

Data contracts are available for tables, topics, API endpoints, dashboards, pipelines, data products, and most other data assets. For the full list and which sections each asset supports, see Supported Assets. This guide creates a contract for a table. The form shows only the tabs an asset supports: Creating a contract requires the Create permission on data contracts. Editing or running one requires Edit All on the contract.

Create a Contract in the UI

  1. On the asset’s table details page, click the Contract tab. Contract Tab
  2. Select Add Contract > Create Contract with UI. Create Contract
  3. On the Contract Details tab, do the following:
    1. Enter a Contract Title.
    2. Optional: Add Owners and a Description, and set the Status. New contracts default to Draft.
    Adding Contract Details
  4. Optional: On the Terms of Service tab, describe how the data may be used.
  5. On the Schema tab, select the columns the contract covers, or select all columns with the checkbox in the header. Only top-level columns can be selected. Schema Tab
  6. On the Semantics tab, do the following:
    1. Click Add Semantics. Add Semantics
    2. Enter a suitable Name and Description.
    3. Add a Rule. The rule builder checks metadata such as owners, description, domain, data product, tags, glossary terms, tier, and status. Add new rule
    4. Click Save.
    Click Add New Rule to add more rules to the same semantic, Add Semantics to add another semantic, and the toggle switch on each rule to turn it on or off. Toggle semantics
  7. Optional: On the Security tab, do the following:
    1. Enter a Data Classification.
    2. Click Add Policy and enter the following details:
      • Access Policy: Name of the access policy consumers should use.
      • Identities: Consumer groups or users, such as Active Directory groups.
      • Row Filters: Column-and-value pairs that describe which rows a consumer should see.
    Security Tab
  8. On the Quality tab, select the table’s existing test cases, or select Add Test to create a new data quality test. Quality Tab
  9. Optional: On the SLA tab, fill in the following details:
    • Refresh Frequency: Expected interval, in hours, days, weeks, months, or years, between data updates.
    • Max Latency: Maximum acceptable value, in minutes, hours, or days, between data generation and availability.
    • Availability Time: Time of day, such as 09:00, and timezone by which the data should be available.
    • Retention: Period, in days, weeks, months, or years, the data is retained.
    • Column: Column that holds the data’s refresh time.
    SLA Tab
  10. Click Save.
For what each section holds and which sections a run checks, see Contract Sections.

Run a Contract

To check the contract now, open the actions menu on the Contract tab and select Run now. Running an OpenMetadata Data Contract A run checks the schema, semantics, and quality sections. The Data Contract Validation application also runs every contract daily at midnight by default. The Contract tab shows the result of each section and an Execution History chart. For what each result means, see Running a Contract.

Manage a Contract

  • Click the Settings icon and the menu shows the following options: Manage Contracts
  • Use the view switch next to the Settings icon to see the contract as YAML. YAML view

Import a Contract

To create a contract from a file instead of the form, select Add Contract > Import OM for an OpenMetadata YAML file, or Add Contract > Import ODCS for an ODCS file. Import Contracts When the asset already has a contract, the import asks how to apply the file:
  • Merge with Existing: Updates the fields the file sets and keeps the rest.
  • Replace Entire Contract: Replaces the contract with the file.

Data Contract Specification

Every section of a data contract and what OpenMetadata checks.