Commit 4ff334e
committed
Use attribute name as authoritative step identifier in graph
FlowGraph._create_nodes walks dir(cls) by attribute name and stores
nodes[element] = node, but DAGNode.name was derived from the AST def
name. Those agreed only by convention. When a metaclass renames a
function via __name__ (e.g. FunctionSpec synthesizing a step), AST
parsing still reads the original def name, leaving nodes keyed by the
attribute name while node.name reports the def name. FlowSpec._init_graph
then does getattr(cls, node.name) and fails with AttributeError.
Pass the discovered attribute name explicitly to DAGNode in the AST
path, and have DAGNode prefer that over func_ast.name. Both paths
(AST and the sourceless single-step fallback) now key on the same
identifier. No behavior change for flows where def name and attribute
name coincide, which is every ordinary flow.1 parent 036ac35 commit 4ff334e
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
397 | 401 | | |
398 | 402 | | |
399 | 403 | | |
| 404 | + | |
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
| |||
0 commit comments