Commit caa5d04
committed
fix: Set results before running task to avoid UnboundLocalError
dbt handles exceptions raised by task.run() with the track_run context
manager. We are also doing the same thing. The problem is that some
exceptions, like FailedToConnectException, are failing silently (at
least for us, CLI users do see a log) and are not re-raised by
dbt.
Continuing with execution would lead to an UnboundLocalError as
we don't account for results never being set. To address this we
preemptively set results to None before running a task.1 parent e97e1c2 commit caa5d04
File tree
2 files changed
+41
-0
lines changed- airflow_dbt_python/hooks
- tests/hooks/dbt
2 files changed
+41
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
| 575 | + | |
| 576 | + | |
575 | 577 | | |
576 | 578 | | |
577 | 579 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 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 | + | |
0 commit comments