From 49342368e552a13a8e5254d3ee10f8b79f24261f Mon Sep 17 00:00:00 2001 From: Max Halford Date: Tue, 14 Nov 2023 20:53:55 +0100 Subject: [PATCH] Update run.py --- lea/app/run.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lea/app/run.py b/lea/app/run.py index d1da8b4..2997287 100644 --- a/lea/app/run.py +++ b/lea/app/run.py @@ -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( @@ -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")