Commits

Antoine Pitrou authored 81c8a0e06bf
ARROW-10209: [Python] Support positional options in compute functions This makes compute functions easier to use, for example here the required "pattern" option doesn't need to be passed by name: ``` >>> pc.split_pattern("abacab", "a") <pyarrow.ListScalar: ['', 'b', 'c', 'b']> ``` ... and producing the following doc at the prompt: ``` split_pattern(strings, /, pattern, *, max_splits=-1, reverse=False, options=None, memory_pool=None) Split string according to separator. Split each string according to the exact `pattern` defined in SplitPatternOptions. The output for each string input is a list of strings. The maximum number of splits and direction of splitting (forward, reverse) can optionally be defined in SplitPatternOptions. Parameters ---------- strings : Array-like or scalar-like Argument to compute function pattern : optional Parameter for SplitPatternOptions constructor. Either `options` or `pattern` can be passed, but not both at the same time. max_splits : optional Parameter for SplitPatternOptions constructor. Either `options` or `max_splits` can be passed, but not both at the same time. reverse : optional Parameter for SplitPatternOptions constructor. Either `options` or `reverse` can be passed, but not both at the same time. options : pyarrow.compute.SplitPatternOptions, optional Parameters altering compute function semantics. memory_pool : pyarrow.MemoryPool, optional If not passed, will allocate memory from the default memory pool. ``` Closes #11955 from pitrou/ARROW-10209-compute-pos-args Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>