You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{%- 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.
The text was updated successfully, but these errors were encountered:
This is the problematic excerpt from the macro:
This code is problematic in case the requested relation does not exist. In that case
adapter.get_relation
returnsNone
, so we end up passingNone
toadapter.get_columns_in_relation
which does not expectsNone
.When using dbt-bigquery adapter it fails with an exception and a cryptic message:
It would be better if before calling to
adapter.get_columns_in_relation
the macro would check ifrelation is None
and raise an explicit compilation error in that case with a proper error message.The text was updated successfully, but these errors were encountered: