formating, better consistency in readers, ability to read files from http (fast and dirty).
This commit is contained in:
@ -13,7 +13,6 @@ Example on how to use :class:`bonobo.Bag` instances to pass flexible args/kwargs
|
||||
|
||||
"""
|
||||
|
||||
|
||||
from random import randint
|
||||
|
||||
from bonobo import Bag, Graph
|
||||
@ -26,10 +25,7 @@ def extract():
|
||||
|
||||
|
||||
def transform(topic: str):
|
||||
return Bag.inherit(
|
||||
title=topic.title(),
|
||||
rand=randint(10, 99)
|
||||
)
|
||||
return Bag.inherit(title=topic.title(), rand=randint(10, 99))
|
||||
|
||||
|
||||
def load(topic: str, title: str, rand: int):
|
||||
|
||||
@ -35,11 +35,7 @@ def load(row: dict):
|
||||
print(row)
|
||||
|
||||
|
||||
graph = Graph(
|
||||
extract,
|
||||
transform,
|
||||
load
|
||||
)
|
||||
graph = Graph(extract, transform, load)
|
||||
|
||||
if __name__ == '__main__':
|
||||
from bonobo import run
|
||||
|
||||
@ -31,11 +31,7 @@ def load(s: str):
|
||||
print(s)
|
||||
|
||||
|
||||
graph = Graph(
|
||||
extract,
|
||||
transform,
|
||||
load
|
||||
)
|
||||
graph = Graph(extract, transform, load)
|
||||
|
||||
if __name__ == '__main__':
|
||||
from bonobo import run
|
||||
|
||||
Reference in New Issue
Block a user