Create and Edit Contracts

With Git-managed contracts, you define your expectations as code using YAML. This gives you full control over how your data is validated, and allows you to manage contracts just like any other code artifact: versioned, tested, and deployed via Git.

To learn all about the structure and supported features, refer to the full specification in the Contract Language Reference

The contract structure includes:

  • Dataset and column structure

  • Available check types (missing, invalid, duplicate, freshness, etc.)

  • Filters (dataset-level and check-level)

  • Threshold configuration

  • Use of variables

  • Scheduling

  • ...and more

Run a dry test (Contract Validation)

Before publishing or verifying your contract, you can run a dry test to ensure the contract is correctly defined and points to a valid dataset.

soda contract test --data-source ds.yml --contract contract.yaml

This will:

  • Validate the YAML syntax

  • Confirm that the referenced dataset exists

  • Check for any issues with variables, filters, or structure

Run this as part of your development workflow or CI to catch errors early.

Publish the Contract

If you have Soda Cloud, once your contract is finalized and tested, you can publish it to Soda Cloud, making it the authoritative version for verification and scheduling.

soda contract publish --contract contract.yaml --soda-cloud sc.yml

Learn how to connect the CLI to Soda Cloud: Connect to Soda Cloud

Publishing:

  • Uploads the contract to Soda Cloud

  • Makes it available for manual, scheduled, or programmatic verifications

  • Enables visibility and collaboration through the UI

Once published, the contract becomes the source of truth for the dataset until a new version is published.

You’re now ready to start verifying your contract and monitoring your data.

Last updated

Was this helpful?