Skip to content

Commit

Permalink
Refactor(executor): get rid of 'running' set (#1861)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas authored Jun 29, 2023
1 parent 0e841a0 commit 15ac3c1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions sqlglot/executor/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def __init__(self, env=None, tables=None):
self.tables = tables or {}

def execute(self, plan):
running = set()
finished = set()
queue = set(plan.leaves)
contexts = {}
Expand All @@ -34,7 +33,6 @@ def execute(self, plan):
for name, table in contexts[dep].tables.items()
}
)
running.add(node)

if isinstance(node, planner.Scan):
contexts[node] = self.scan(node, context)
Expand All @@ -49,11 +47,10 @@ def execute(self, plan):
else:
raise NotImplementedError

running.remove(node)
finished.add(node)

for dep in node.dependents:
if dep not in running and all(d in contexts for d in dep.dependencies):
if all(d in contexts for d in dep.dependencies):
queue.add(dep)

for dep in node.dependencies:
Expand Down

0 comments on commit 15ac3c1

Please sign in to comment.