Skip to content

Commit ab2b1ae

Browse files
committed
message change
1 parent 99ce1b6 commit ab2b1ae

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

R/data.table.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ replace_dot_alias = function(e) {
12431243
} else if (.is_simple_extraction(name)) {
12441244
.assign_in_parent(
12451245
name, x, parent.frame(),
1246-
err_msg_len = "Cannot assign to an under-allocated recursively indexed list -- L[[i]][,:=] syntax is only valid when i is length 1, but its length is %d",
1246+
err_msg_len = "The index for recursive assignment must be length 1, but its length is %d.",
12471247
err_msg_na = NULL # Triggers internal_error for this case
12481248
)
12491249
} # TO DO: else if env$<- or list$<-

inst/tests/tests.Rraw

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15880,7 +15880,7 @@ test(2074.03, data.table(grade=c(50L, 91L, 95L, 51L, 89L))[ , .N, by=evaluate(gr
1588015880
## error: use recursive character list indexing to assign when also doing alloc.col()
1588115881
opt = options(datatable.alloccol=1L)
1588215882
l = list(foo = list(bar = data.table(a = 1:3, b = 4:6)))
15883-
test(2074.04, l[[c('foo', 'bar')]][ , (letters) := 16:18], error = 'under-allocated recursively indexed list')
15883+
test(2074.04, l[[c('foo', 'bar')]][ , (letters) := 16:18], error = 'The index for recursive assignment must be length 1')
1588415884
options(opt)
1588515885
## alloc.col when using 0-truelength j assigning to a subset
1588615886
DT = data.table(a=1)
@@ -21167,3 +21167,9 @@ test(2317.6, DT1[DF1, on='a', .(d = x.a + i.d)]$d, 5)
2116721167
test(2317.7, DT1[DF2, on='a', e := i.e]$e, 5)
2116821168
test(2317.8, DT1[DF2, on='a', e2 := x.a + i.e]$e2, 6)
2116921169
test(2317.9, DT1[DF2, on='a', .(e = x.a + i.e)]$e, 6)
21170+
21171+
# Test for issue #6702: ensure setDT gives a user-friendly error on multi-element recursive indexes
21172+
test(2318.1, {
21173+
data_store = list(nested = list(df_to_fix = data.frame(id = 1:3, val = letters[1:3])))
21174+
setDT(data_store[[c("nested", "df_to_fix")]])
21175+
}, error = "index for recursive assignment must be length 1")

0 commit comments

Comments
 (0)