Source

Inheritance diagram of dbt_contracts.contracts.terms.source.HasDownstreamDependencies, dbt_contracts.contracts.terms.source.HasFreshness, dbt_contracts.contracts.terms.source.HasLoader

Classes

HasDownstreamDependencies(*[,Β min_count,Β ...])

Check whether sources have an appropriate number of downstream dependencies.

HasFreshness()

Check whether sources have freshness configured in their properties.

HasLoader()

Check whether sources have appropriate configuration for a loader in their properties.

class dbt_contracts.contracts.terms.source.HasLoader

Bases: NodeContractTerm

Check whether sources have appropriate configuration for a loader in their properties.

run(item: ItemT, context: ContractContext, parent: ParentT = None) → bool

Validate the context before running the term.

class dbt_contracts.contracts.terms.source.HasFreshness

Bases: NodeContractTerm

Check whether sources have freshness configured in their properties.

run(item: ItemT, context: ContractContext, parent: ParentT = None) → bool

Validate the context before running the term.

class dbt_contracts.contracts.terms.source.HasDownstreamDependencies(*, min_count: Annotated[int, Ge(ge=1)] = 1, max_count: Annotated[int | None, Gt(gt=0)] = None)

Bases: NodeContractTerm, RangeMatcher

Check whether sources have an appropriate number of downstream dependencies.

needs_manifest: ClassVar[bool] = True

Mark if this term requires a loaded manifest to operate. The manifest must then be provided by the ContractContext for the term to execute successfully.

run(item: ItemT, context: ContractContext, parent: ParentT = None) → bool

Validate the context before running the term.