[nodes] Adds arg0_to_kwargs and kwargs_to_arg0 transformations.

This commit is contained in:
Romain Dorgueil
2017-07-11 16:25:32 +02:00
parent 71386ea30c
commit 53d6ac5887

View File

@ -10,11 +10,13 @@ from bonobo.util.objects import ValueHolder
from bonobo.util.term import CLEAR_EOL
__all__ = [
'identity',
'Limit',
'Tee',
'count',
'PrettyPrinter',
'Tee',
'arg0_to_kwargs',
'count',
'identity',
'kwargs_to_arg0',
'noop',
]
@ -86,3 +88,11 @@ class PrettyPrinter(Configurable):
def noop(*args, **kwargs): # pylint: disable=unused-argument
from bonobo.constants import NOT_MODIFIED
return NOT_MODIFIED
def arg0_to_kwargs(row):
return Bag(**row)
def kwargs_to_arg0(**row):
return Bag(row)