Issue with modifying an empty nested table
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Start by running the reproducible R example from the issue and inspect how nested table assignment handles the empty s2 case. Trace the relevant data.table code and add or run a regression test for adding an empty column to an empty nested table; done means the parent column keeps its correct type and no malformed data.table error occurs.
Written by the indexing model from the issue text.
Description
Hi all,
Yet another corner case that hit me:
tab <- data.table(s1 = list(data.table()), s2 = list(data.table()), s3 = list(data.table(v = 1)))
tab[, s1 := lapply(s1, \(x) x)]
tab[, s2 := lapply(s2, \(x) { x[, dummy := numeric()]; x})]
tab[, s3 := lapply(s3, \(x) { x[, dummy := 2]; x})]
print(tab)
s1 s2 s3
<list> <data.table> <list>
1: <data.table[0x0]> <multi-column> <data.table[1x2]>
So, adding an empty column to an empty nested table (case s2), somehow changes the type of the parent column where the nested table is in. As a result, I get errors such as Column X ['XXX'] is a data.frame or data.table; malformed data.table.
Thanks,
Rick
- Dominant language
- R
- Stars
- 3.9k
- Forks
- 1.1k
- Avg merge
- 14h 4m
- Merged PRs (30d)
- 4
Contributor 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 Rdatatable/data.table
-
as.data.table() recurses without end on a survival::Surv object (or any data.frame carrying one) Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Rdatatable/data.table#7887 ·
-
consistency tests
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Rdatatable/data.table#7853 · 3 comments ·
-
internals
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Rdatatable/data.table#6938 · 1 comment ·
-
encoding fread
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Rdatatable/data.table#5179 · 8 comments ·
-
documentation programming
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Rdatatable/data.table#3199 · 3 comments ·
All issues in Rdatatable/data.table
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
beginners blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enviPathR OpenBuild Error Build OK Build Warning policies-accepted pre-review precheck-passed
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Bioconductor/BiocContributions#207 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
datacarpentry/semester-biology#1255 ·