dbt Models
prefect_dbt_flow.dbt
Code for managing and configuring a dbt project.
DbtDagOptions
dataclass
Class to add dbt DAG configurations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
select |
Optional[str]
|
dbt module to include in the run |
None
|
exclude |
Optional[str]
|
dbt module to exclude in the run |
None
|
run_test_after_model |
bool
|
run test afeter run model |
False
|
vars |
Optional[dict[str, str]]
|
dbt vars |
None
|
install_deps |
bool
|
install dbt dependencies, default behavior install deps |
True
|
Source code in prefect_dbt_flow/dbt/__init__.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
DbtNode
dataclass
Class that represents a dbt node in the project.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
dbt node name, e. my_model_a |
required |
unique_id |
str
|
dbt id e. model.sample_project.my_model_a |
required |
resource_type |
DbtResourceType
|
dbt resource type, e. model or seed |
required |
depends_on |
List[str]
|
e. ["model.sample_project.my_model_b"] |
required |
has_tests |
bool
|
if node is a test |
False
|
Source code in prefect_dbt_flow/dbt/__init__.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
DbtProfile
dataclass
Class that represents a dbt profile configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target |
str
|
dbt target, usualy "dev" or "prod" |
required |
overrides |
Optional[dict[str, str]]
|
dbt profile overrides |
None
|
Source code in prefect_dbt_flow/dbt/__init__.py
34 35 36 37 38 39 40 41 42 43 44 45 |
|
DbtProject
dataclass
Class that represents a dbt project configuration.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of dbt project, |
required |
project_dir |
Union[str, Path]
|
Path to directory that contains dbt project.yml |
required |
profiles_dir |
Union[str, Path]
|
Path to directory that contains dbt profiles.yml |
required |
Source code in prefect_dbt_flow/dbt/__init__.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
DbtResourceType
Bases: Enum
Enum class that represents a dbt resource type.
Source code in prefect_dbt_flow/dbt/__init__.py
8 9 10 11 12 13 14 15 |
|