ibis.expr.api.Expr.pipe

Expr.pipe(f, *args, **kwargs)

Generic composition function to enable expression pipelining

>>> (expr
>>>  .pipe(f, *args, **kwargs)
>>>  .pipe(g, *args2, **kwargs2))

is equivalent to

>>> g(f(expr, *args, **kwargs), *args2, **kwargs2)
Parameters:

f : function or (function, arg_name) tuple

If the expression needs to be passed as anything other than the first argument to the function, pass a tuple with the argument name. For example, (f, ‘data’) if the function f expects a ‘data’ keyword

args : positional arguments

kwargs : keyword arguments

Returns:

result : result type of passed function

Examples

>>> def foo(data, a=None, b=None):
...     pass
>>> def bar(a, b, data=None):
...     pass
>>> expr.pipe(foo, a=5, b=10)
>>> expr.pipe((bar, 'data'), 1, 2)