Simon
03/28/2023, 3:07 PMGraphDefinition
?
GraphDefinition(node_defs=[someop.alias("foo")], ...)
doesn't work, it results in the following exception
AttributeError: 'PendingNodeInvocation' object has no attribute '__name__'
This seems to be the same as this issue from end of 2021 https://github.com/dagster-io/dagster/issues/5603
I also tried this
GraphDefinition(node_defs=[NodeInvocation(name="wait", alias="testalias")], ...)
but this also doesn't work, it results in
dagster._core.errors.DagsterInvalidDefinitionError: Invalid item in node list: NodeInvocation
Is there a way to make this work?sean
03/28/2023, 8:34 PMSimon
03/29/2023, 11:23 AMnode_defs
only contains Ops. In case of one Op that's aliased several times in one graph I only see that Op once in graph_def.node_defs
when using @graph
. So aliased Ops don't show up in there.
Then I did some more prodding and it seems the aliasing is done as part of dependencies
where they are added as NodeInvocation
as keys of the dict and then they can be referenced in other values in the dependencies dict, like so
{NodeInvocation(name="op_name", alias="fooalias"): {}, "bar": {"after": DependencyDefinition("fooalias")}
I didn't expect that the aliasing would need to be done as part of the dependencies
config, that's a bit surprising to me.
In any case, given how this currently works I'm not sure the bug is correct, although it might be useful to come up with a better/clearer way to do this.
Alternatively if the current way is fine it would be good to mention this in the Graphdefinition.dependencies
docs.