Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rbindlist() now returns correct idcols for lists with different length vectors #3786

Merged
merged 3 commits into from Aug 30, 2019

Conversation

shrektan
Copy link
Member

@shrektan shrektan commented Aug 21, 2019

Closes #3785

After the PR the below code works.

library(data.table)
x = 1:1000
X = rbindlist(lapply(x, function(.) list(., 1:2, 2:3)), idcol = 'TAG')
all.equal(X$TAG, rep(x, each = 2))

x = setNames(x, paste0("nm_", x))
X = rbindlist(lapply(x, function(.) list(., 1:2, 2:3)), idcol = 'TAG')
all.equal(X$TAG, rep(names(x), each = 2))

@shrektan shrektan added this to the 1.12.4 milestone Aug 21, 2019
inst/tests/tests.Rraw Outdated Show resolved Hide resolved
Copy link
Member

@jangorecki jangorecki left a comment

LGTM

@codecov
Copy link

@codecov codecov bot commented Aug 21, 2019

Codecov Report

Merging #3786 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3786   +/-   ##
=======================================
  Coverage   99.41%   99.41%           
=======================================
  Files          71       71           
  Lines       13245    13245           
=======================================
  Hits        13168    13168           
  Misses         77       77
Impacted Files Coverage Δ
src/rbindlist.c 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8567b74...d04a876. Read the comment docs.

@mattdowle mattdowle merged commit 3a090bc into master Aug 30, 2019
4 checks passed
@mattdowle mattdowle deleted the fix3785 branch Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants