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 givennodeis configured to be materialized.meta: Check whether a givenresourcehas any matching meta to the accepted_values.name: Check whether a givenitemhas a valid name.paths: Check whether a givenitemhas 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 givennodehas an appropriate number of constraints.has_contract: Check whether the node properties define a contract.has_description: Check whether the givenresourcehas a description set.has_expected_columns: Check whether the node properties contain the expected set ofcolumns.has_matching_description: Check whether the givennodehas a description configured which matches the remote resource.has_no_final_semicolon: Check whether the givennodehas a no closing semicolon at the end of the script.has_no_hardcoded_refs: Check whether the givennodehas a no hardcoded upstream references.has_properties: Check whether the givenresourcehas properties set in an appropriate properties file.has_tests: Check whether the givennodehas an appropriate number of tests.has_valid_macro_dependencies: Check whether the givennodehas valid upstream macro dependencies.has_valid_ref_dependencies: Check whether the givennodehas valid upstream ref dependencies.has_valid_source_dependencies: Check whether the givennodehas valid upstream source dependencies.meta_has_accepted_values: Check whether the resource'smetaconfig is configured as expected.meta_has_allowed_keys: Check whether the resource'smetaconfig contains only allowed keys.meta_has_required_keys: Check whether the resource'smetaconfig contains all required keys.tags_have_allowed_values: Check whether the givenresourcehas properties set in an appropriate properties file.tags_have_required_values: Check whether the givenresourcehas properties set in an appropriate properties file.
Model Columns
Filters
meta: Check whether a givenresourcehas any matching meta to the accepted_values.name: Check whether a givenitemhas a valid name.
Enforcements
exists: Check whether the column exists in the database.has_data_type: Check whether the givencolumnof the givenparenthas a data type set.has_description: Check whether the givenresourcehas a description set.has_expected_name: Check whether the givencolumnof the givenparenthas a name that matches some expectation.has_matching_data_type: Check whether the givencolumnof the givenparenthas_matching_description: Check whether the givencolumnof the givenparenthas_matching_index: Check whether the givencolumnof the givenparenthas_tests: Check whether the givencolumnof the givenparenthas an appropriate number of tests.meta_has_accepted_values: Check whether the resource'smetaconfig is configured as expected.meta_has_allowed_keys: Check whether the resource'smetaconfig contains only allowed keys.meta_has_required_keys: Check whether the resource'smetaconfig contains all required keys.tags_have_allowed_values: Check whether the givenresourcehas properties set in an appropriate properties file.tags_have_required_values: Check whether the givenresourcehas properties set in an appropriate properties file.
Sources
Filters
is_enabled: Check whether the givensourceis enabled.meta: Check whether a givenresourcehas any matching meta to the accepted_values.name: Check whether a givenitemhas a valid name.paths: Check whether a givenitemhas 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 givenresourcehas a description set.has_downstream_dependencies: Check whether the givensourcehas freshness configured.has_expected_columns: Check whether the node properties contain the expected set ofcolumns.has_freshness: Check whether the givensourcehas freshness configured.has_loader: Check whether the givensourcehas a loader configured.has_matching_description: Check whether the givennodehas a description configured which matches the remote resource.has_properties: Check whether the givenresourcehas properties set in an appropriate properties file.has_tests: Check whether the givennodehas an appropriate number of tests.meta_has_accepted_values: Check whether the resource'smetaconfig is configured as expected.meta_has_allowed_keys: Check whether the resource'smetaconfig contains only allowed keys.meta_has_required_keys: Check whether the resource'smetaconfig contains all required keys.tags_have_allowed_values: Check whether the givenresourcehas properties set in an appropriate properties file.tags_have_required_values: Check whether the givenresourcehas properties set in an appropriate properties file.
Source Columns
Filters
meta: Check whether a givenresourcehas any matching meta to the accepted_values.name: Check whether a givenitemhas a valid name.
Enforcements
exists: Check whether the column exists in the database.has_data_type: Check whether the givencolumnof the givenparenthas a data type set.has_description: Check whether the givenresourcehas a description set.has_expected_name: Check whether the givencolumnof the givenparenthas a name that matches some expectation.has_matching_data_type: Check whether the givencolumnof the givenparenthas_matching_description: Check whether the givencolumnof the givenparenthas_matching_index: Check whether the givencolumnof the givenparenthas_tests: Check whether the givencolumnof the givenparenthas an appropriate number of tests.meta_has_accepted_values: Check whether the resource'smetaconfig is configured as expected.meta_has_allowed_keys: Check whether the resource'smetaconfig contains only allowed keys.meta_has_required_keys: Check whether the resource'smetaconfig contains all required keys.tags_have_allowed_values: Check whether the givenresourcehas properties set in an appropriate properties file.tags_have_required_values: Check whether the givenresourcehas properties set in an appropriate properties file.
Macros
Filters
name: Check whether a givenitemhas a valid name.paths: Check whether a givenitemhas a valid path.
Enforcements
has_description: Check whether the givenresourcehas a description set.has_properties: Check whether the givenresourcehas properties set in an appropriate properties file.
Macro Arguments
Filters
name: Check whether a givenitemhas a valid name.
Enforcements
has_description: Check whether the givenresourcehas a description set.has_type: Check whether the givenargumenthas 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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:
-
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:
-
Permalink:
geo-martino/dbt-contracts@24f677f7591dd10d543fe3e067c28bc5c36dddeb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/geo-martino
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@24f677f7591dd10d543fe3e067c28bc5c36dddeb -
Trigger Event:
release
-
Statement 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:
-
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:
-
Permalink:
geo-martino/dbt-contracts@24f677f7591dd10d543fe3e067c28bc5c36dddeb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/geo-martino
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@24f677f7591dd10d543fe3e067c28bc5c36dddeb -
Trigger Event:
release
-
Statement type: