Skip to content

Commit

Permalink
chore: add docstring for agg
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Sep 14, 2023
1 parent f9fd340 commit 1e0b6a1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions ibis/expr/operations/udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,35 @@ class agg(_UDF):
__slots__ = ()

_base = AggUDF

@util.experimental
@classmethod
def builtin(cls, *args: Any, **kwargs: Any) -> Callable:
"""Construct an aggregate user-defined function that is built-in to the backend.
Parameters
----------
fn
The The function to wrap.
args
Configuration arguments for the UDF.
name
The name of the UDF in the backend if different from the function name.
schema
The schema in which the builtin function resides.
kwargs
Additional configuration arguments for the UDF.
Examples
--------
>>> import ibis
>>> ibis.options.interactive = True
>>> @ibis.udf.agg.builtin
... def favg(a: float) -> float:
... '''Compute the average of a column using Kahan summation.'''
>>> t = ibis.examples.penguins.fetch()
>>> expr = favg(t.bill_length_mm)
>>> expr
43.9219298245614
"""
return super().builtin(*args, **kwargs)

0 comments on commit 1e0b6a1

Please sign in to comment.