bonobo icon indicating copy to clipboard operation
bonobo copied to clipboard

Doc: Orphan Nodes / Chains incorrect

Open Guilherme-B opened this issue 4 years ago • 1 comments

As far as I can tell, the guide present in the Orphan Nodes / Chains is incorrect, or at least, not compliant with the current lib version.

Consider the following base:

def gen():
    yield 'asda'
    yield 'another1'
    
def upper(x):
    return x.upper()

def show(x):
    print(x)

Chaining directly:

graph = bonobo.Graph()
graph.add_chain(gen, upper, show)
bonobo.run(graph)

works just fine, prints the upper cased data as expected. However, applying the tutorial directly:

graph = bonobo.Graph()

graph.add_node(gen)
graph.add_node(upper)
graph.add_node(show)

graph.add_chain(_input = gen, _output = upper)
graph.add_chain(_input= upper, _output= show)

bonobo.run(graph)

And no output is given. The nodes seem to run independently, not being connected in any way - unfortunately I cannot test it with GraphViz.

Guilherme-B avatar Mar 03 '20 11:03 Guilherme-B

Hello.

Would you be so kind to propose a documentation patch about this?

Thanks.

hartym avatar Apr 30 '20 05:04 hartym