Simplify the way coercion happens for list columns in rbindlist

Open
#6,353 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
r
Domain
data

Research direction

Start at the rbindlist implementation and inspect the list-column coercion region described in the issue, including its listprotect, PROTECT, and UNPROTECT handling. Read the discussion in #6263, #5448, and PR #6311, then use rchk to verify that the refactored protection pattern is simpler and passes checking without exceeding the protection stack.

Written by the indexing model from the issue text.

Description

[rbind|cbind|merge]list
          AFAIU #6263 our pattern with `listprotect`, `PROTECT` and `UNPROTECT` inside the if cannot be checked with rchk.

However, we need this pattern because of the protection stack size(see #5448).

WDYT should we try to use a PROTECT_WITH_INDEX instead?

Originally posted by @ben-schwen in https://github.com/Rdatatable/data.table/pull/6311#pullrequestreview-2218834243

This region is quite complicated & causing headaches for rchk. I think we would do well to refactor it for simplicity.

Dominant language
R
Stars
3.9k
Forks
1.1k
Avg merge
14h 4m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Rdatatable/data.table

All issues in Rdatatable/data.table

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.