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

More robust setDT #4193

Closed
wants to merge 10 commits into from
Closed

More robust setDT #4193

wants to merge 10 commits into from

Conversation

sritchie73
Copy link
Contributor

@sritchie73 sritchie73 commented Jan 22, 2020

Fixes #4176

This PR reorganises the code within setDT() so that the checks currently made on list objects (checks for POSIXlt and heterogeneous column lengths) are made regardless of the class of the input, and that setalloccol() is only called once all checks have passed. This means you now can't bypass these checks by simply adding "data.table" or "data.frame" as a class to a list of mixed column lengths. I've also fixed the column length checking code to ignore NULL columns, as per #3480 and #3471, which would have triggered the range-failure check unless all columns were NULL or otherwise length 0.

Ideally it would be nice to be able to move some of these checks into setalloccol(), so that we could use selfrefok(x) > 0L as a way of checking an input object is a non-malformed data.table.

@codecov
Copy link

codecov bot commented Jan 22, 2020

Codecov Report

Merging #4193 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4193      +/-   ##
==========================================
+ Coverage   99.61%   99.61%   +<.01%     
==========================================
  Files          72       72              
  Lines       13871    13880       +9     
==========================================
+ Hits        13817    13826       +9     
  Misses         54       54
Impacted Files Coverage Δ
R/data.table.R 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 c005296...f019499. Read the comment docs.

@sritchie73 sritchie73 closed this May 18, 2020
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.

List checks in setDT should proceed when class data.table but selfref not ok
1 participant