Models
Objects related to loading the dbt manifest.
Column
dataclass
Represents a column in a model.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the column. |
description |
str
|
The description of the column. |
data_type |
str | None
|
The data type of the column. |
meta |
dict[str, Any]
|
The metadata attached to the column. |
constraints |
list[Constraint]
|
The list of constraints attached to the column. |
tags |
list[str]
|
The list of tags attached to the column. |
tests |
list[Test]
|
The list of tests attached to the column. |
_raw_values |
dict[str, Any]
|
The raw values of the column as defined in the node. |
_raw_test_values |
list[dict[str, Any]]
|
The raw test values of the column as defined in the node. |
Source code in src/dbt_score/models.py
from_node_values(values, test_values)
classmethod
Create a column object from raw values.
Source code in src/dbt_score/models.py
Constraint
dataclass
Constraint for a column.
Attributes:
Name | Type | Description |
---|---|---|
type |
str
|
The type of the constraint, e.g. |
name |
str | None
|
The name of the constraint. |
expression |
str | None
|
The expression of the constraint, e.g. |
_raw_values |
dict[str, Any]
|
The raw values of the constraint in the manifest. |
Source code in src/dbt_score/models.py
from_raw_values(raw_values)
classmethod
Create a constraint object from a constraint node in the manifest.
Source code in src/dbt_score/models.py
ManifestLoader
Load the models and tests from the manifest.
Source code in src/dbt_score/models.py
__init__(file_path, select=None)
Initialize the ManifestLoader.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
Path
|
The file path of the JSON manifest. |
required |
select |
Iterable[str] | None
|
An optional dbt selection. |
None
|
Source code in src/dbt_score/models.py
Model
dataclass
Represents a dbt model.
Attributes:
Name | Type | Description |
---|---|---|
unique_id |
str
|
The id of the model, e.g. |
name |
str
|
The name of the model. |
relation_name |
str
|
The relation name of the model, e.g. |
description |
str
|
The full description of the model. |
original_file_path |
str
|
The sql path of the model, |
config |
dict[str, Any]
|
The config of the model. |
meta |
dict[str, Any]
|
The meta of the model. |
columns |
list[Column]
|
The list of columns of the model. |
package_name |
str
|
The package name of the model. |
database |
str
|
The database name of the model. |
schema |
str
|
The schema name of the model. |
raw_code |
str
|
The raw code of the model. |
language |
str
|
The language of the model, e.g. sql. |
access |
str
|
The access level of the model, e.g. public. |
alias |
str | None
|
The alias of the model. |
patch_path |
str | None
|
The yml path of the model, e.g. |
tags |
list[str]
|
The list of tags attached to the model. |
tests |
list[Test]
|
The list of tests attached to the model. |
depends_on |
dict[str, list[str]]
|
Dictionary of models/sources/macros that the model depends on. |
_raw_values |
dict[str, Any]
|
The raw values of the model (node) in the manifest. |
_raw_test_values |
list[dict[str, Any]]
|
The raw test values of the model (node) in the manifest. |
Source code in src/dbt_score/models.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
__hash__()
from_node(node_values, test_values)
classmethod
Create a model object from a node and it's tests in the manifest.
Source code in src/dbt_score/models.py
Test
dataclass
Test for a column or model.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the test. |
type |
str
|
The type of the test, e.g. |
kwargs |
dict[str, Any]
|
The kwargs of the test. |
tags |
list[str]
|
The list of tags attached to the test. |
_raw_values |
dict[str, Any]
|
The raw values of the test in the manifest. |
Source code in src/dbt_score/models.py
from_node(test_node)
classmethod
Create a test object from a test node in the manifest.