basic reimplementation of what was working in rdc.etl, jupyter widget, json import, demo with opendatasoft api, etc. Lot of things are still work in progress, stay tuned.
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
from bonobo.core.graph import Graph
|
||||
from bonobo.core.strategy import NaiveStrategy, ExecutorStrategy
|
||||
import time
|
||||
from random import randint
|
||||
|
||||
from bonobo.core.graphs import Graph
|
||||
from bonobo.core.strategies.executor import ThreadPoolExecutorStrategy
|
||||
from bonobo.ext.console import ConsoleOutputPlugin
|
||||
|
||||
|
||||
def extract():
|
||||
@ -9,19 +13,20 @@ def extract():
|
||||
|
||||
|
||||
def transform(s):
|
||||
return s.title()
|
||||
wait = randint(0, 1)
|
||||
time.sleep(wait)
|
||||
return s.title() + ' ' + str(wait)
|
||||
|
||||
|
||||
def load(s):
|
||||
print(s)
|
||||
|
||||
|
||||
Strategy = ThreadPoolExecutorStrategy
|
||||
|
||||
if __name__ == '__main__':
|
||||
etl = Graph()
|
||||
etl.add_chain(extract, transform, load)
|
||||
|
||||
s = NaiveStrategy()
|
||||
s.execute(etl)
|
||||
|
||||
s = ExecutorStrategy()
|
||||
s.execute(etl)
|
||||
s = Strategy()
|
||||
s.execute(etl, plugins=[ConsoleOutputPlugin()])
|
||||
|
||||
Reference in New Issue
Block a user