Skip to content

Commit

Permalink
if a referenced schema is not in the cache, do not try to add a link …
Browse files Browse the repository at this point in the history
…to it
  • Loading branch information
Jacob Beck committed Oct 9, 2018
1 parent 4c928c6 commit c85cb43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dbt/adapters/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,16 @@ def add_link(self, referenced, dependent):
schema=referenced.schema,
identifier=referenced.name
)
if referenced.schema not in self:
# if we have not cached the referenced schema at all, we must be
# referring to a table outside our control. There's no need to make
# a link - we will never drop the referenced relation during a run.
logger.debug(
'{dep!s} references {ref!s} but {ref.schema} is not in the '
'cache, skipping assumed external relation'
.format(dep=dependent, ref=referenced)
)
return
dependent = _ReferenceKey(
schema=dependent.schema,
identifier=dependent.name
Expand Down

0 comments on commit c85cb43

Please sign in to comment.