NVIDIA / NVIDIA/cudf

[BUG] Setitem on struct columns picks out incorrect pieces when indexing of rvalue is not from zero.

Open
#13,293 2 comments 3 reactions 0 assignees View on GitHub
0 - Backlog bug Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**

```python
import cudf

s = cudf.Series([{"a": 1}, {"a": 2}, {"a": 3}])
g = cudf.Series([{"a": 4}, {"a": 5}, {"a": 6}])

s.iloc[1:2] = g.iloc[2:3]

s.iloc[1:2]
# 1 {'a': 4}
# dtype: struct

g.iloc[2:3]
# 2 {'a': 6}
# dtype: struct

# An even more fun:

x = g.iloc[2:3].copy(deep=True)

s.iloc[1] = x.iloc[0]

s.iloc[1] # => {'a': 6} Good!

s.iloc[1] = x.iloc[:]

s.iloc[1] # => {'a': 4} What!
```

Oops.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.