NVIDIA / NVIDIA/cudf

Behaviour of inplace for `copy_range` when range is empty.

Open
#12,135 0 comments 0 reactions 0 assignees View on GitHub
Python question
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

In `copying.copy_range` we have an `inplace=False/True` argument.

If `inplace` is `True`, then the column is modified in place, if `inplace` is False, a new (copied) column is created and then modified. If the case that the range we are copying is empty, at present `inplace=False` _still_ returns a new copy (even though `copy_range` is a no-op in this situation).

Should it be allowed that

```
copy_range(source, target, empty_range, inplace=False)
```

Can return `target` (rather than a copy of `target`)?

See discussion where this came p: https://github.com/rapidsai/cudf/pull/12075#discussion_r1015307155

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.