apache / apache/arrow

Function 'binary_replace_slice' has no kernel matching input types (list<item: string>)

Open
#39,229 0 comments 0 reactions 0 assignees View on GitHub
Component: Python Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 18h
Merged PRs (30d)
91

Description

### Describe the bug, including details regarding any error messages, version, and platform.

I am unable to use `compute.binary_replace_slice` to transform a column in a batch of a dataset.

Other functions with the same signature work just fine, for example `binary_join`

To illustrate the bug

```py

import pyarrow as pa
import pyarrow.compute as pc
import pyarrow.dataset as ds

data = {
"id": ["id1", "id2"],
"video-formats": [["v11", "v12", "v12"], []],
}
table = pa.table(
{
"id": pa.array(data["id"]),
"video-formats": pa.array(data["video-formats"]),
}
)

dataset = ds.dataset(table)
for b in dataset.to_batches(batch_size=2):
for a in pc.binary_join(b["video-formats"], "#"): # this work
print(a)

dataset = ds.dataset(table)
for b in dataset.to_batches(batch_size=2):
for a in pc.binary_replace_slice(b["video-formats"], 0, 1, "#"): # this does not work
print(a)

```

### Component(s)

Python

Contributor guide

Open the contributing guide

Research direction

Start with the supplied Python reproduction using pc.binary_replace_slice on the dataset batch, and compare it with the working pc.binary_join call. Trace the binary_replace_slice entry point and its kernel type matching; the issue is done when the reported list input is handled consistently with the example's expected transformation.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.