-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
This is the problematic excerpt from the macro:
{%- set relation = adapter.get_relation(
database=database_name,
schema=schema_name,
identifier=table_name) -%}
{%- set columns_from_relation = adapter.get_columns_in_relation(relation) -%}
This code is problematic in case the requested relation does not exist. In that case adapter.get_relation
returns None
, so we end up passing None
to adapter.get_columns_in_relation
which does not expects None
.
When using dbt-bigquery adapter it fails with an exception and a cryptic message:
Flow run encountered an exception.
RuntimeError: Runtime Error
'NoneType' object has no attribute 'database'
It would be better if before calling to adapter.get_columns_in_relation
the macro would check if relation is None
and raise an explicit compilation error in that case with a proper error message.
Metadata
Metadata
Assignees
Labels
No labels