Commits

Antoine Pitrou authored 56005368433
ARROW-10316: [Python] Improve introspection of compute function options Generate a signature for compute functions that better reflects the accepted arguments. Example before: ```python >>> pc.sum? Signature: pc.sum(array, *, options=None, memory_pool=None, **kwargs) Docstring: Compute the sum of a numeric array. [...] ``` Same example after: ```python >>> ?pc.sum Signature: pc.sum( array, *, memory_pool=None, options=None, skip_nulls=True, min_count=1, ) Docstring: Compute the sum of a numeric array. [...] ``` One caveat is that the individual options are not explicitly documented (yet): ``` Parameters ---------- array : Array-like Argument to compute function memory_pool : pyarrow.MemoryPool, optional If not passed, will allocate memory from the default memory pool. options : pyarrow.compute.ScalarAggregateOptions, optional Parameters altering compute function semantics **kwargs : optional Parameters for ScalarAggregateOptions constructor. Either `options` or `**kwargs` can be passed, but not both at the same time. ``` Closes #10581 from pitrou/ARROW-10316-wrapped-compute-func Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>