Skip to content

Commit

Permalink
Update run.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Nov 14, 2023
1 parent f135171 commit 4934236
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lea/app/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ def _yield_whitelist(query, include_ancestors, include_descendants):
if include_descendants:
yield from dag.list_descendants(key)

return set(_yield_whitelist(query, include_ancestors=False, include_descendants=False))
return {
key
for key in _yield_whitelist(query, include_ancestors=False, include_descendants=False)
# Some nodes in the graph are not part of the views, such as third-party tables
if key in dag
}


def run(
Expand All @@ -190,6 +195,8 @@ def run(

# Determine which views need to be run
whitelist = (
# If multiple select queries are provided, we want to run the union of all the views they
# select. We use a set union to remove duplicates.
set.union(*(make_whitelist(query, dag) for query in select)) if select else set(dag.keys())
)
console_log(f"{len(whitelist):,d} view(s) selected")
Expand Down

0 comments on commit 4934236

Please sign in to comment.