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
Hi all, first contribution to a project so please let me know if I've done anything wrong! 😄
Only a small change but a key one for the functionality of this macro, I think.
Currently, when collecting the models names to check presence in the target DB, the macro only looks at node.name. This means aliased models are not checked correctly and models still in use are dropped.
Simple suggested solution is to swap current_models.append(node.name) with current_models.append(node.name if node.config.alias == None else node.config.alias)
The text was updated successfully, but these errors were encountered:
SFL-PR
changed the title
dbt-utils drop_old_relations doesn't take into account model aliases
BUG: dbt-utils drop_old_relations doesn't take into account model aliases
Nov 10, 2023
Hi all, first contribution to a project so please let me know if I've done anything wrong! 😄
Only a small change but a key one for the functionality of this macro, I think.
Currently, when collecting the models names to check presence in the target DB, the macro only looks at
node.name
. This means aliased models are not checked correctly and models still in use are dropped.Simple suggested solution is to swap
current_models.append(node.name)
withcurrent_models.append(node.name if node.config.alias == None else node.config.alias)
The text was updated successfully, but these errors were encountered: