-
Notifications
You must be signed in to change notification settings - Fork 991
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
setDT stop on matrix-column downgraded to warning #3851
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3851 +/- ##
==========================================
+ Coverage 99.42% 99.42% +<.01%
==========================================
Files 71 71
Lines 13409 13412 +3
==========================================
+ Hits 13332 13335 +3
Misses 77 77
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
^
which triggers the I think we'll have to condition on |
@mattdowle have a look at latest commit. Basically want to allow
Unfortunately An alternative would be w the latest commit, |
…htly more simply without tackling arrays
Not sure what was happening relating to the array aspect of |
if (length(x)>1L) { | ||
idx = vapply_1i(x, function(xi) length(dim(xi)))>1L | ||
if (any(idx)) | ||
warning("Some columns are a multi-column type (such as a matrix column): ", brackify(which(idx)),". setDT will retain these columns as-is but subsequent operations like grouping and joining may fail. Please consider as.data.table() instead which will create a new column for each embedded column.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me it sounds better to raise error, and ask revdep maintainer for update to as.data.table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but revdeps are just a proxy for the (larger) outside-CRAN usage. The goal is to minimize required-communication with revdep maintainers so that we communicate changes via the messages and warnings wherever possible. In this case, there is no change to behavior but we went from nothing straight to error. The warning is a softer first step. That's my current thinking anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also was a bit hesitant about warning initially, but actually you can get this error from data.table() and as.data.table() since both call as.data.table.list which works by running setDT at the end.
in the case of data.table(1D-array) it would require overhauling how as.data.table.array works or building a new branch in as.data.table.list for the vector-embedded-in-higher-dimensions case
(which maybe we could/should do but perhaps file for another day?)
Follow up to PR #3770
Resolves
miceFast
,MultiFit
,sensobol
, andgenomic.autocorr
in #3581