python-bonobo / bonobo

Extract Transform Load for Python 3.5+
https://www.bonobo-project.org/
Apache License 2.0
1.59k stars 146 forks source link

Doc: Orphan Nodes / Chains incorrect #370

Open Guilherme-B opened 4 years ago

Guilherme-B commented 4 years ago

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.

hartym commented 4 years ago

Hello.

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

Thanks.