Commit 8fb8ad1
fix: add explicit return(none) in get_elementary_relation when relation not found
The v0.24.0 refactoring (PR #1006) added a deferral fallback but removed
the unconditional return of adapter.get_relation()'s result. When the
adapter returns None and deferral is off, the macro now falls through
without calling return(). In dbt's Jinja2, this means the macro returns
its rendered template text (whitespace) instead of None. Since a non-empty
string is truthy, callers that check `if relation` incorrectly proceed
as if the table exists, producing SQL like `from <whitespace>` which
causes BigQuery syntax errors.
Add an explicit `return(none)` at the end to restore the v0.23.1
contract: when a relation is not found and deferral is not active,
the macro returns None.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>1 parent bf2747f commit 8fb8ad1
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
0 commit comments