Skip to content

Commit

Permalink
error on empty list of relations
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Dec 19, 2023
1 parent d609da9 commit 3afd659
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbt/adapters/spark/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ def _get_one_catalog_by_relations(
manifest: Manifest,
) -> agate.Table:
columns: List[Dict[str, Any]] = []
if len(relations) == 0:
raise dbt.exceptions.CompilationError(
"Expected at least one relation in spark _get_one_catalog_by_relations, found None"
)
for relation in relations:
logger.debug(f"Getting table schema for relation {relation}")
columns.extend(self._get_columns_for_catalog(relation))
Expand Down

0 comments on commit 3afd659

Please sign in to comment.