apache / apache/arrow

[Python] pyarrow.compute functions don't convert args with __arrow_array__.

Open
#30,711 1 comment 0 reactions 0 assignees View on GitHub
Component: Python Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

When the compute functions pack args, lists and numpy arrays are converted into arrow arrays, but objects with `__arrow_array__` defined aren't. A TypeError is raised.

**Reporter**: [A. Coady](https://issues.apache.org/jira/browse/ARROW-15210) / @coady
#### Related issues:
- [[Python] Create pyarrow array using an object's `__array__` method.](https://github.com/apache/arrow/issues/30703) (is related to)
#### PRs and other links:
- [GitHub Pull Request #12048](https://github.com/apache/arrow/pull/12048)

**Note**: *This issue was originally created as [ARROW-15210](https://issues.apache.org/jira/browse/ARROW-15210). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Research direction

Start by tracing how pyarrow.compute functions pack arguments and compare conversion of lists and NumPy arrays with objects defining __arrow_array__. Reproduce the TypeError, then verify that those objects are converted successfully by the compute functions without regressing existing argument handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.