Enforce standards for your dbt projects through automated checks and generators
Project description
dbt-contracts
Enforce standards for your dbt projects through automated checks and generators
Contents
Installation
Install through pip using one of the following commands:
pip install dbt-contracts
python -m pip install dbt-contracts
Contracts Reference
Below you will find a list of all available contracts grouped by the dbt object it operates on. Refer to this list to help when designing your contract file.
Models
Filters
is_materialized
: Check whether the givennode
is configured to be materialized.meta
: Check whether a givenresource
has any matching meta to the accepted_values.name
: Check whether a givenitem
has a valid name.paths
: Check whether a givenitem
has a valid path.
Enforcements
exists
: Check whether the node exists in the database.has_all_columns
: Check whether the node properties contain all available columns of the node.has_constraints
: Check whether the givennode
has an appropriate number of constraints.has_contract
: Check whether the node properties define a contract.has_description
: Check whether the givenresource
has a description set.has_expected_columns
: Check whether the node properties contain the expected set ofcolumns
.has_matching_description
: Check whether the givennode
has a description configured which matches the remote resource.has_no_final_semicolon
: Check whether the givennode
has a no closing semicolon at the end of the script.has_no_hardcoded_refs
: Check whether the givennode
has a no hardcoded upstream references.has_properties
: Check whether the givenresource
has properties set in an appropriate properties file.has_tests
: Check whether the givennode
has an appropriate number of tests.has_valid_macro_dependencies
: Check whether the givennode
has valid upstream macro dependencies.has_valid_ref_dependencies
: Check whether the givennode
has valid upstream ref dependencies.has_valid_source_dependencies
: Check whether the givennode
has valid upstream source dependencies.meta_has_accepted_values
: Check whether the resource'smeta
config is configured as expected.meta_has_allowed_keys
: Check whether the resource'smeta
config contains only allowed keys.meta_has_required_keys
: Check whether the resource'smeta
config contains all required keys.tags_have_allowed_values
: Check whether the givenresource
has properties set in an appropriate properties file.tags_have_required_values
: Check whether the givenresource
has properties set in an appropriate properties file.
Model Columns
Filters
meta
: Check whether a givenresource
has any matching meta to the accepted_values.name
: Check whether a givenitem
has a valid name.
Enforcements
exists
: Check whether the column exists in the database.has_data_type
: Check whether the givencolumn
of the givenparent
has a data type set.has_description
: Check whether the givenresource
has a description set.has_expected_name
: Check whether the givencolumn
of the givenparent
has a name that matches some expectation.has_matching_data_type
: Check whether the givencolumn
of the givenparent
has_matching_description
: Check whether the givencolumn
of the givenparent
has_matching_index
: Check whether the givencolumn
of the givenparent
has_tests
: Check whether the givencolumn
of the givenparent
has an appropriate number of tests.meta_has_accepted_values
: Check whether the resource'smeta
config is configured as expected.meta_has_allowed_keys
: Check whether the resource'smeta
config contains only allowed keys.meta_has_required_keys
: Check whether the resource'smeta
config contains all required keys.tags_have_allowed_values
: Check whether the givenresource
has properties set in an appropriate properties file.tags_have_required_values
: Check whether the givenresource
has properties set in an appropriate properties file.
Sources
Filters
is_enabled
: Check whether the givensource
is enabled.meta
: Check whether a givenresource
has any matching meta to the accepted_values.name
: Check whether a givenitem
has a valid name.paths
: Check whether a givenitem
has a valid path.
Enforcements
exists
: Check whether the node exists in the database.has_all_columns
: Check whether the node properties contain all available columns of the node.has_description
: Check whether the givenresource
has a description set.has_downstream_dependencies
: Check whether the givensource
has freshness configured.has_expected_columns
: Check whether the node properties contain the expected set ofcolumns
.has_freshness
: Check whether the givensource
has freshness configured.has_loader
: Check whether the givensource
has a loader configured.has_matching_description
: Check whether the givennode
has a description configured which matches the remote resource.has_properties
: Check whether the givenresource
has properties set in an appropriate properties file.has_tests
: Check whether the givennode
has an appropriate number of tests.meta_has_accepted_values
: Check whether the resource'smeta
config is configured as expected.meta_has_allowed_keys
: Check whether the resource'smeta
config contains only allowed keys.meta_has_required_keys
: Check whether the resource'smeta
config contains all required keys.tags_have_allowed_values
: Check whether the givenresource
has properties set in an appropriate properties file.tags_have_required_values
: Check whether the givenresource
has properties set in an appropriate properties file.
Source Columns
Filters
meta
: Check whether a givenresource
has any matching meta to the accepted_values.name
: Check whether a givenitem
has a valid name.
Enforcements
exists
: Check whether the column exists in the database.has_data_type
: Check whether the givencolumn
of the givenparent
has a data type set.has_description
: Check whether the givenresource
has a description set.has_expected_name
: Check whether the givencolumn
of the givenparent
has a name that matches some expectation.has_matching_data_type
: Check whether the givencolumn
of the givenparent
has_matching_description
: Check whether the givencolumn
of the givenparent
has_matching_index
: Check whether the givencolumn
of the givenparent
has_tests
: Check whether the givencolumn
of the givenparent
has an appropriate number of tests.meta_has_accepted_values
: Check whether the resource'smeta
config is configured as expected.meta_has_allowed_keys
: Check whether the resource'smeta
config contains only allowed keys.meta_has_required_keys
: Check whether the resource'smeta
config contains all required keys.tags_have_allowed_values
: Check whether the givenresource
has properties set in an appropriate properties file.tags_have_required_values
: Check whether the givenresource
has properties set in an appropriate properties file.
Macros
Filters
name
: Check whether a givenitem
has a valid name.paths
: Check whether a givenitem
has a valid path.
Enforcements
has_description
: Check whether the givenresource
has a description set.has_properties
: Check whether the givenresource
has properties set in an appropriate properties file.
Macro Arguments
Filters
name
: Check whether a givenitem
has a valid name.
Enforcements
has_description
: Check whether the givenresource
has a description set.has_type
: Check whether the givenargument
has its type set in an appropriate properties file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dbt_contracts-0.1.0.tar.gz
.
File metadata
- Download URL: dbt_contracts-0.1.0.tar.gz
- Upload date:
- Size: 29.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c81f0197133684eceb7f9355f6d9b06c48179f8e6555c8e2697d60653060f861 |
|
MD5 | 5462964203bb2b7739aa7053b5875e15 |
|
BLAKE2b-256 | 26272278307c54ffceb6e51fa17f3e2345d24113681ecab2d3c91001e17388d4 |
Provenance
The following attestation bundles were made for dbt_contracts-0.1.0.tar.gz
:
Publisher:
deploy.yml
on geo-martino/dbt-contracts
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
dbt_contracts-0.1.0.tar.gz
- Subject digest:
c81f0197133684eceb7f9355f6d9b06c48179f8e6555c8e2697d60653060f861
- Sigstore transparency entry: 147068970
- Sigstore integration time:
- Predicate type:
File details
Details for the file dbt_contracts-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: dbt_contracts-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adbcf8947a27ddf021306b3d048ef2797994ef2d04be458067622fdcfc4a8418 |
|
MD5 | fae93fcf5bac54d90c0f92e532d0e7f6 |
|
BLAKE2b-256 | c4b91a0353c0de08c57e241c867c7e79c8383c1e7c0b67e9d80907828a721cf8 |
Provenance
The following attestation bundles were made for dbt_contracts-0.1.0-py3-none-any.whl
:
Publisher:
deploy.yml
on geo-martino/dbt-contracts
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
dbt_contracts-0.1.0-py3-none-any.whl
- Subject digest:
adbcf8947a27ddf021306b3d048ef2797994ef2d04be458067622fdcfc4a8418
- Sigstore transparency entry: 147068972
- Sigstore integration time:
- Predicate type: