Skip to content

Commit

Permalink
fix bug where equality was checking using is (which checks memory loc…
Browse files Browse the repository at this point in the history
…) which prevents class overloading and re-mapping. Switched to a simple module + class name mapping as those should still be unique (#202)
  • Loading branch information
ncilfone committed Jan 11, 2022
1 parent 14aa1ab commit 9f2d2f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spock/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ def _build(self):
"""
# Build a dictionary of all nodes (base spock classes)
nodes = {val: [] for val in self._input_classes}
node_names = [f"{k.__module__}.{k.__name__}" for k in nodes.keys()]
# Iterate thorough all of the base spock classes to get the dependencies and reverse dependencies
for input_class in self._input_classes:
dep_classes = self._find_all_spock_classes(input_class)
for v in dep_classes:
if v not in nodes:
if f"{v.__module__}.{v.__name__}" not in node_names:
raise ValueError(
f"Missing @spock decorated class -- `{v.__name__}` was not passed as an *arg to "
f"ConfigArgBuilder"
Expand Down

0 comments on commit 9f2d2f0

Please sign in to comment.