Antoine Pitrou created ARROW-14766:
--------------------------------------

             Summary: [Python] compute function arguments cannot be passed by 
name, despite the exposed signature
                 Key: ARROW-14766
                 URL: https://issues.apache.org/jira/browse/ARROW-14766
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
            Reporter: Antoine Pitrou


Example:
{code:python}
>>> pc.is_in_meta_binary?
Signature: pc.is_in_meta_binary(values, value_set, *, memory_pool=None)
Docstring:
Find each element in a set of values.

For each element in `values`, return true if it is found in `value_set`,
false otherwise.

Parameters
----------
values : Array-like or scalar-like
    Argument to compute function
value_set : Array-like or scalar-like
    Argument to compute function
memory_pool : pyarrow.MemoryPool, optional
    If not passed, will allocate memory from the default memory pool.
File:      ~/arrow/dev/python/pyarrow/compute.py
Type:      function
{code}
{code:python}
>>> pc.is_in_meta_binary(["a", "b", "c"], ["a", "b"])
<pyarrow.lib.BooleanArray object at 0x7f63c5dfad00>
[
  true,
  true,
  false
]
>>> pc.is_in_meta_binary(["a", "b", "c"], value_set=["a", "b"])
Traceback (most recent call last):
  File "<ipython-input-5-ea763d55e2a9>", line 1, in <module>
    pc.is_in_meta_binary(["a", "b", "c"], value_set=["a", "b"])
TypeError: wrapper() got an unexpected keyword argument 'value_set'
{code}

Two possible solutions:
* mark the argument positional-only
* (better) change the generated wrapper to accept said named arguments




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to