From 047c90f0d6674a18a2a31b33d4a0521f182bf83a Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 12 Apr 2024 00:03:06 -0700 Subject: [PATCH] regression test for #1873 (#6080) --- inst/tests/tests.Rraw | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index d3a0e37e8..d33bd72a6 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -18450,3 +18450,7 @@ test(2256.4, fread(f, verbose=TRUE), DT, output="sep=',' so dec set to '.'") fwrite(DT, f, dec=',', sep=';') test(2256.5, fread(f, verbose=TRUE), DT, output="dec=',' detected based on a balance of 18") test(2256.6, fread('a;b\n1,14;5', verbose=TRUE), data.table(a=1.14, b=5L), output="dec=',' detected based on a balance of 1 ") + +# helpful error about deleting during grouping, #1873 +DT = data.table(id = c(1, 1, 2, 2), a = 1:4, b = 5:8) +test(2257, DT[ , c("c", "a") := .(a + 1, NULL), by=id], error="it's not possible to delete parts of a column")