set call setalloccol for non-selfrefok tables when removing columns#7500
set call setalloccol for non-selfrefok tables when removing columns#7500ben-schwen merged 3 commits intomasterfrom
set call setalloccol for non-selfrefok tables when removing columns#7500Conversation
|
I think #7492 omitted NEWS because it was fixing an issue in dev; I guess this needs NEWS because 1.18.0 will already be on CRAN? I guess this will need to simmer a bit to answer that with certainty. |
True, but I guess that depends on whether we were able to submit |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7500 +/- ##
=======================================
Coverage 99.04% 99.04%
=======================================
Files 87 87
Lines 16694 16699 +5
=======================================
+ Hits 16534 16539 +5
Misses 160 160 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
No obvious timing issues in HEAD=set_delete Generated via commit 156f4ff Download link for the artifact containing the test results: ↓ atime-results.zip
|
Not sure either, I've asked Kurt about it. Will let you know when he tells me. Asked what the priority is (getting a fix on CRAN with needing a patch in the next month or waiting to get it on CRAN until after the holidays). |
R/data.table.R
Outdated
| ok = selfrefok(x, verbose=FALSE) | ||
| if (ok < 1L) { | ||
| # Table is not safe to resize (either fresh from disk or shallow copy) | ||
| setalloccol(x, n=eval(getOption("datatable.alloccol")), verbose=FALSE) |
There was a problem hiding this comment.
Unfortunately, this only fixes x in the environment of set. Now set needs to reassign x in the caller's environment. Would this be enough, or do we need the deeper magic from [.data.table?
xsub <- substitute(x)
# setalloccol(...)
eval(
substitute(
x <- xnew,
list(x = xsub, xnew = x)
),
parent.frame()
)There was a problem hiding this comment.
if ((is.null(value) || (is.list(value) && any(vapply_1b(value, is.null)))) && selfrefok(x, verbose=FALSE) < 1L) {
name = substitute(x)
setalloccol(x, verbose=FALSE)
if (is.name(name)) {
assign(as.character(name), x, parent.frame(), inherits=TRUE)
}
}There was a problem hiding this comment.
Are we expecting people to call set() on sub-expressions (e.g. set(foo[[bar]]$baz, i, j, value))? If not, this should definitely work, thank you!
There was a problem hiding this comment.
well if someone is putting set on sub-expressions, he should probably self assign the results anyway

Closes #7501
Follows #7492