Lineage#
Note
The below checks require manifest.json to be present.
Checks related to source lineage and usage.
Functions:
| Name | Description |
|---|---|
check_source_not_orphaned |
Sources must be referenced in at least one model. |
check_source_used_by_models_in_same_directory |
Sources can only be referenced by models that are located in the same directory where the source is defined. |
check_source_used_by_only_one_model |
Each source can be referenced by a maximum of one model. |
check_source_not_orphaned
#
Sources must be referenced in at least one model.
Receives at execution time:
| Name | Type | Description |
|---|---|---|
models |
list[ModelNode]
|
List of ModelNode objects parsed from |
source |
SourceNode
|
The SourceNode object to check. |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
str | None
|
Description of what the check does and why it is implemented. |
exclude |
str | None
|
Regex pattern to match the source path (i.e the .yml file where the source is configured). Source paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the source path (i.e the .yml file where the source is configured). Only source paths that match the pattern will be checked. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):
Source code in src/dbt_bouncer/checks/manifest/sources/lineage.py
check_source_used_by_models_in_same_directory
#
Sources can only be referenced by models that are located in the same directory where the source is defined.
Receives at execution time:
| Name | Type | Description |
|---|---|---|
source |
SourceNode
|
The SourceNode object to check. |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
str | None
|
Description of what the check does and why it is implemented. |
exclude |
str | None
|
Regex pattern to match the source path (i.e the .yml file where the source is configured). Source paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the source path (i.e the .yml file where the source is configured). Only source paths that match the pattern will be checked. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):
Source code in src/dbt_bouncer/checks/manifest/sources/lineage.py
check_source_used_by_only_one_model
#
Each source can be referenced by a maximum of one model.
Receives at execution time:
| Name | Type | Description |
|---|---|---|
models |
list[ModelNode]
|
List of ModelNode objects parsed from |
source |
SourceNode
|
The SourceNode object to check. |
Other Parameters (passed via config file):
| Name | Type | Description |
|---|---|---|
description |
str | None
|
Description of what the check does and why it is implemented. |
exclude |
str | None
|
Regex pattern to match the source path (i.e the .yml file where the source is configured). Source paths that match the pattern will not be checked. |
include |
str | None
|
Regex pattern to match the source path (i.e the .yml file where the source is configured). Only source paths that match the pattern will be checked. |
severity |
Literal[error, warn] | None
|
Severity level of the check. Default: |
Example(s):