Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-aalam committed Oct 22, 2024
1 parent 3b797ce commit a26656e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,13 @@ def _contains_external_cte_ref(self, node: TreeNode, root: TreeNode) -> bool:
if isinstance(node, SnowflakePlan) and isinstance(
node.source_plan, WithQueryBlock
):
return False
ignore_with_query_block = node.source_plan
else:
ignore_with_query_block = None

for with_query_block, node_count in node.referenced_ctes.items():
if with_query_block is ignore_with_query_block:
continue
root_count = root.referenced_ctes[with_query_block]
if node_count != root_count:
return True
Expand Down

0 comments on commit a26656e

Please sign in to comment.