You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2021/12/15 12:31:00 UTC
[jira] [Resolved] (ARROW-14766) [Python] compute function arguments cannot be passed by name, despite the exposed signature
[ https://issues.apache.org/jira/browse/ARROW-14766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joris Van den Bossche resolved ARROW-14766.
-------------------------------------------
Fix Version/s: 7.0.0
Resolution: Fixed
Issue resolved by pull request 11951
[https://github.com/apache/arrow/pull/11951]
> [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
> Assignee: Antoine Pitrou
> Priority: Minor
> Labels: pull-request-available
> Fix For: 7.0.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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)