Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ rowwiseDT(

20. Fixed a memory issue causing segfaults in `forder`, [#6797](https://github.com/Rdatatable/data.table/issues/6797). Thanks @dkutner for the report and @MichaelChirico for the fix.

21. `setDT(get0('var'))` now correctly modifies `var` by reference, consistent with the long-standing behavior of `setDT(get('var'))`. Previously, the `.internal.selfref` attribute was not set, [#6864](https://github.com/Rdatatable/data.table/issues/6864). Thanks to @rikivillalba for the report and @venom1204 for the fix.
Comment thread
MichaelChirico marked this conversation as resolved.
Outdated

### NOTES

1. There is a new vignette on joins! See `vignette("datatable-joins")`. Thanks to Angel Feliz for authoring it! Feedback welcome. This vignette has been highly requested since 2017: [#2181](https://github.com/Rdatatable/data.table/issues/2181).
Expand Down
2 changes: 1 addition & 1 deletion R/data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,7 @@ setDT = function(x, keep.rownames=FALSE, key=NULL, check.names=FALSE) {
} else if (.is_simple_extraction(name)) {
# common case is call from 'lapply()'
.reassign_extracted_table(name, x)
} else if (name %iscall% "get") { # #6725
} else if (name %iscall% c("get", "get0")) { # #6725
# edit 'get(nm, env)' call to be 'assign(nm, x, envir=env)'
name = match.call(get, name)
name[[1L]] = quote(assign)
Expand Down
11 changes: 11 additions & 0 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -21183,3 +21183,14 @@ test(2317.6, DT1[DF1, on='a', .(d = x.a + i.d)]$d, 5)
test(2317.7, DT1[DF2, on='a', e := i.e]$e, 5)
test(2317.8, DT1[DF2, on='a', e2 := x.a + i.e]$e2, 6)
test(2317.9, DT1[DF2, on='a', .(e = x.a + i.e)]$e, 6)

#6864
# issue #6864, test that setDT(get0(...)) preserves .internal.selfref with a simple dataset
dt = data.frame(a = 1:3, b = letters[1:3])
ds_get = copy(dt)
Comment thread
MichaelChirico marked this conversation as resolved.
Outdated
x_get = setDT(get("ds_get"))
Comment thread
MichaelChirico marked this conversation as resolved.
Outdated
test(2319.1, !is.null(attr(ds_get, ".internal.selfref")))
ds_get0 = copy(dt)
x_get0 = setDT(get0("ds_get0"))
test(2319.2, !is.null(attr(ds_get0, ".internal.selfref")))
test(2319.3, identical(ds_get0, x_get0))
Comment thread
MichaelChirico marked this conversation as resolved.
Outdated
Loading