smell: removes whitespace
This commit is contained in:
@ -21,32 +21,32 @@ class Service(Option):
|
|||||||
identifier. For example, you can create a Configurable that has a "database" Service in its attribute, meaning that
|
identifier. For example, you can create a Configurable that has a "database" Service in its attribute, meaning that
|
||||||
you'll define which database to use, by name, when creating the instance of this class, then provide an
|
you'll define which database to use, by name, when creating the instance of this class, then provide an
|
||||||
implementation when running the graph using a strategy.
|
implementation when running the graph using a strategy.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
import bonobo
|
import bonobo
|
||||||
|
|
||||||
class QueryExtractor(bonobo.Configurable):
|
class QueryExtractor(bonobo.Configurable):
|
||||||
database = bonobo.Service(default='sqlalchemy.engine.default')
|
database = bonobo.Service(default='sqlalchemy.engine.default')
|
||||||
|
|
||||||
graph = bonobo.Graph(
|
graph = bonobo.Graph(
|
||||||
QueryExtractor(database='sqlalchemy.engine.secondary'),
|
QueryExtractor(database='sqlalchemy.engine.secondary'),
|
||||||
*more_transformations,
|
*more_transformations,
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
engine = create_engine('... dsn ...')
|
engine = create_engine('... dsn ...')
|
||||||
bonobo.run(graph, services={
|
bonobo.run(graph, services={
|
||||||
'sqlalchemy.engine.secondary': engine
|
'sqlalchemy.engine.secondary': engine
|
||||||
})
|
})
|
||||||
|
|
||||||
The main goal is not to tie transformations to actual dependencies, so the same can be run in different contexts
|
The main goal is not to tie transformations to actual dependencies, so the same can be run in different contexts
|
||||||
(stages like preprod, prod, or tenants like client1, client2, or anything you want).
|
(stages like preprod, prod, or tenants like client1, client2, or anything you want).
|
||||||
|
|
||||||
.. attribute:: name
|
.. attribute:: name
|
||||||
|
|
||||||
Service name will be used to retrieve the implementation at runtime.
|
Service name will be used to retrieve the implementation at runtime.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, __doc__=None):
|
def __init__(self, name, __doc__=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user