Consistency between `dt.cbind()` and `Frame.cbind()`
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the dt.cbind() and Frame.cbind() API documentation linked in the issue, then reproduce the two examples involving DT and DT[:, :]. Compare the documented and actual return and mutation behavior, and clarify or implement an agreed consistency approach with coverage for views and regular frames.
Written by the indexing model from the issue text.
Description
Currently, dt.cbind() returns a new frame by cbinding all the input frames. At the same time Frame.cbind() method appends frames to the original one.
This behavior could be quite confusing for users, because they may expect Frame.cbind() method to return a new frame also, when we return None. While changing API may not be a good idea from the compatibility point of view, we could think about at least issuing a warning when Frame.cbind() is called on views.
For example, the following code doesn't modify the original DT frame, while some users may think it does
>>> from datatable import dt
>>> DT = dt.Frame([1,2,3])
>>> DT[:, :].cbind(DT)
DatatableWarning: Duplicate column name found, and was assigned a unique name: 'C0' -> 'C1'
>>> DT
| C0
| int32
-- + -----
0 | 1
1 | 2
2 | 3
[3 rows x 1 column]
At the same time, this code works perfectly fine
>>> DT.cbind(DT)
>>> DT
| C0 C1
| int32 int32
-- + ----- -----
0 | 1 1
1 | 2 2
2 | 3 3
[3 rows x 2 columns]
Since DT[:, :] and DT essentially represent the same thing, it could be a hard time for users understanding the code above.
It seems that even in our documentation we kind of confusing in-place and out-of-place functionality when say
This function is exactly equivalent to:
dt.Frame().cbind(*frames, force=force)
Because in reality dt.cbind() produces a new frame and it is not equivalent to dt.Frame().cbind() that cbinds everything to an empty frame and returns None.
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 164
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from h2oai/datatable
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepseek-ai/DeepGEMM-Ascend#49 ·
Maintainers usually reply within 1 day
-
bug needs testing platform:windows topic:buildsystem topic:platforms
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
godotengine/godot#126110 · 1 comment ·
Maintainers usually reply within 1 day
-
comp-s3queue
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ClickHouse/ClickHouse#137649 ·
Maintainers usually reply within 1 day
-
area/docdb kind/enhancement mvu-pg15-pg19 priority/low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
yugabyte/yugabyte-db#40355 ·
Maintainers usually reply within 1 day
-
Clear params.inputs in dials.indexPossibly taken @phyy-nx claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dials/dials#3361 · 1 comment ·
Maintainers usually reply within 1 day