Properties

Inheritance diagram of dbt_contracts.contracts.terms.properties.HasAllowedMetaKeys, dbt_contracts.contracts.terms.properties.HasAllowedMetaValues, dbt_contracts.contracts.terms.properties.HasAllowedTags, dbt_contracts.contracts.terms.properties.HasDescription, dbt_contracts.contracts.terms.properties.HasProperties, dbt_contracts.contracts.terms.properties.HasRequiredMetaKeys, dbt_contracts.contracts.terms.properties.HasRequiredTags

Classes

HasAllowedMetaKeys(*[, keys])

Check whether the {kind} have only meta keys set from a configured permitted list.

HasAllowedMetaValues(*, meta, ...)

Check whether the {kind} have only meta values set from a configured permitted mapping of keys to values.

HasAllowedTags(*[, tags])

Check whether the {kind} have only tags set from a configured permitted list.

HasDescription()

Check whether the {kind} have descriptions defined in their properties.

HasProperties()

Check whether the {kind} have properties files defined.

HasRequiredMetaKeys(*[, keys])

Check whether the {kind} have the expected set of required meta keys set.

HasRequiredTags(*[, tags])

Check whether the {kind} have the expected set of required tags set.

class dbt_contracts.contracts.terms.properties.HasProperties

Bases: ParentContractTerm, Generic

Check whether the {kind} have properties files defined.

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

Validate the context before running the term.

class dbt_contracts.contracts.terms.properties.HasDescription

Bases: ChildContractTerm, Generic

Check whether the {kind} have descriptions defined in their properties.

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

Validate the context before running the term.

class dbt_contracts.contracts.terms.properties.HasRequiredTags(*, tags: Annotated[Sequence[str], BeforeValidator(func=to_tuple, json_schema_input_type=PydanticUndefined)] = ())

Bases: ChildContractTerm, Generic

Check whether the {kind} have the expected set of required tags set.

tags: Annotated[Sequence[str], BeforeValidator(func=to_tuple, json_schema_input_type=PydanticUndefined)]
run(item: ItemT, context: ContractContext, parent: ParentT = None) → bool

Validate the context before running the term.

class dbt_contracts.contracts.terms.properties.HasAllowedTags(*, tags: Annotated[Sequence[str], BeforeValidator(func=to_tuple, json_schema_input_type=PydanticUndefined)] = ())

Bases: ChildContractTerm, Generic

Check whether the {kind} have only tags set from a configured permitted list.

tags: Annotated[Sequence[str], BeforeValidator(func=to_tuple, json_schema_input_type=PydanticUndefined)]
run(item: ItemT, context: ContractContext, parent: ParentT = None) → bool

Validate the context before running the term.

class dbt_contracts.contracts.terms.properties.HasRequiredMetaKeys(*, keys: Annotated[Sequence[str], BeforeValidator(func=to_tuple, json_schema_input_type=PydanticUndefined)] = ())

Bases: ChildContractTerm, Generic

Check whether the {kind} have the expected set of required meta keys set.

keys: Annotated[Sequence[str], BeforeValidator(func=to_tuple, json_schema_input_type=PydanticUndefined)]
run(item: ItemT, context: ContractContext, parent: ParentT = None) → bool

Validate the context before running the term.

class dbt_contracts.contracts.terms.properties.HasAllowedMetaKeys(*, keys: Annotated[Sequence[str], BeforeValidator(func=to_tuple, json_schema_input_type=PydanticUndefined)] = ())

Bases: ChildContractTerm, Generic

Check whether the {kind} have only meta keys set from a configured permitted list.

keys: Annotated[Sequence[str], BeforeValidator(func=to_tuple, json_schema_input_type=PydanticUndefined)]
run(item: ItemT, context: ContractContext, parent: ParentT = None) → bool

Validate the context before running the term.

class dbt_contracts.contracts.terms.properties.HasAllowedMetaValues(*, meta: ~collections.abc.Mapping[str, ~collections.abc.Sequence[str]] = <factory>)

Bases: ChildContractTerm, Generic

Check whether the {kind} have only meta values set from a configured permitted mapping of keys to values.

meta: Mapping[str, Sequence[str]]
classmethod make_meta_values_tuple(meta: Mapping[str, str | Sequence[str]]) → dict[str, tuple[str]]

Convert all meta values to tuples

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

Validate the context before running the term.