Skip to content

Commit 8fb8ad1

Browse files
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

File tree

macros/utils/graph/get_elementary_relation.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,6 @@
4747
)
4848
) %}
4949
{% endif %}
50+
{% do return(none) %}
5051
{%- endif %}
5152
{% endmacro %}

0 commit comments

Comments
 (0)