[ https://issues.apache.org/jira/browse/ARROW-14766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17445930#comment-17445930 ]
Joris Van den Bossche commented on ARROW-14766: ----------------------------------------------- Yes, that is what I noticed in ARROW-14732 as well, and before that fix, you also got a very confusing error message of you tried to use it as a keyword argument. With ARROW-14732, the error messaging now basically is as if it's positional only (your first bullet point, in which case it would indeed be nice to also reflect this in the signature). Personally, I don't really see the need to also allow them as named arguments. The meta kernel you use above in your example is a bit of an exception, but in general there is not much use in being able to do something like {{pc.add(x=[0, 1, 2], y=[1, 2, 3])}} (moreover because we are not very consistent in the naming of those positional arguments, and allowing them to be used as keywords would bake in those names) > [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 > Priority: Minor > > 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)