dbt CLI
prefect_dbt_flow.dbt.cli
Utility functions for interacting with dbt using command-line commands.
dbt_deps(project, profile, dag_options)
Function that executes dbt deps
command
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project |
DbtProject
|
A class that represents a dbt project configuration. |
required |
profile |
Optional[DbtProfile]
|
A class that represents a dbt profile configuration. |
required |
dag_options |
Optional[DbtDagOptions]
|
A class to add dbt DAG configurations. |
required |
Returns:
Type | Description |
---|---|
str
|
A string representing the output of the |
Source code in prefect_dbt_flow/dbt/cli.py
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 |
|
dbt_ls(project, dag_options, profile, output='json')
Code that lists resources from the dbt project, using dbt ls
command.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project |
DbtProject
|
A class that represents a dbt project configuration. |
required |
dag_options |
Optional[DbtDagOptions]
|
A class to add dbt DAG configurations. |
required |
profile |
Optional[DbtProfile]
|
A class that represents a dbt profile configuration. |
required |
output |
str
|
Format of output, default is JSON. |
'json'
|
Returns:
Type | Description |
---|---|
str
|
list of JSON objects containing dbt resources. |
Source code in prefect_dbt_flow/dbt/cli.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
dbt_run(project, model, profile, dag_options)
Function that executes dbt run
command
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project |
DbtProject
|
A class that represents a dbt project configuration. |
required |
model |
str
|
Name of the model to run. |
required |
profile |
Optional[DbtProfile]
|
A class that represents a dbt profile configuration. |
required |
dag_options |
Optional[DbtDagOptions]
|
A class to add dbt DAG configurations. |
required |
Returns:
Type | Description |
---|---|
str
|
A string representing the output of the |
Source code in prefect_dbt_flow/dbt/cli.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
dbt_seed(project, seed, profile, dag_options)
Function that executes dbt seed
command
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project |
DbtProject
|
A class that represents a dbt project configuration. |
required |
seed |
str
|
Name of the seed to run. |
required |
profile |
Optional[DbtProfile]
|
A class that represents a dbt profile configuration. |
required |
dag_options |
Optional[DbtDagOptions]
|
A class to add dbt DAG configurations. |
required |
Returns:
Type | Description |
---|---|
str
|
A string representing the output of the |
Source code in prefect_dbt_flow/dbt/cli.py
115 116 117 118 119 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 |
|
dbt_snapshot(project, snapshot, profile, dag_options)
Function that executes dbt snapshot
command
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project |
DbtProject
|
A class that represents a dbt project configuration. |
required |
snapshot |
str
|
Name of the snapshot to run. |
required |
profile |
Optional[DbtProfile]
|
A class that represents a dbt profile configuration. |
required |
dag_options |
Optional[DbtDagOptions]
|
A class to add dbt DAG configurations. |
required |
Returns:
Type | Description |
---|---|
str
|
A string representing the output of the |
Source code in prefect_dbt_flow/dbt/cli.py
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 |
|
dbt_test(project, model, profile, dag_options)
Function that executes dbt test
command
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project |
DbtProject
|
A class that represents a dbt project configuration. |
required |
model |
str
|
Name of the model to run. |
required |
profile |
Optional[DbtProfile]
|
A class that represents a dbt profile configuration. |
required |
dag_options |
Optional[DbtDagOptions]
|
A class to add dbt DAG configurations. |
required |
Returns:
Type | Description |
---|---|
str
|
A string representing the output of the |
Source code in prefect_dbt_flow/dbt/cli.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|