feat(ingestion/dbt): add support for ingesting DBT contracts as Data Contracts #15428
+665
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add support for ingesting DBT model contracts (introduced in dbt 1.5) as DataHub Data Contract entities with schema and data quality assertions.
Closes #11927
What problem does this solve?
DBT introduced model contracts in v1.5, allowing teams to define and enforce schema guarantees on models. However, DataHub had no way to ingest this contract metadata - it was lost during ingestion, and users couldn't see which models had contractual guarantees.
This PR bridges DBT's data governance (contracts) with DataHub's data governance (Data Contracts, Assertions), giving teams a unified view of their data quality guarantees.
What changes are being made?
New Configuration Options
ingest_contractsfalsecontract_test_tag"contract"ingest_column_constraints_as_assertionstruenot_null,unique,primary_keyconstraintsNew Data Structures
DBTContractdataclass - capturesenforced,alias_types,checksumfrom manifestDBTConstraintdataclass - captures column/model-level constraints (not_null,unique,primary_key, etc.)Contract Ingestion Flow
When
ingest_contracts: trueand a model hascontract.enforced: true:not_null,unique,primary_keyconstraintscontract_test_tagare linkedDataContractPropertiesClassPlatform Support
meta.contractormeta.datahub_contract(API doesn't expose contracts directly)How was this tested?
DBTContract,DBTConstraint)contract.enforced: trueChecklist
Screenshots/Demo
After ingestion with
ingest_contracts: true, models withcontract.enforced: truewill have:not_null/unique/primary_key