Skip to content

Commit 9fbd711

Browse files
committed
test correction
1 parent cfcd238 commit 9fbd711

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
10. `data.table()` and `as.data.table()` with `keep.rownames=TRUE` now extract row names from named vectors, matching `data.frame()` behavior. Names from the first named vector in the input are used to create the row names column (default name `"rn"` or custom name via `keep.rownames="column_name"`), [#1916](https://github.com/Rdatatable/data.table/issues/1916). Thanks to @richierocks for the feature request and @Mukulyadav2004 for the implementation.
4848

49-
11. Assigning a raw function to a new column, e.g. `DT[, new_col := mean]`, now throws an informative error. This prevents a common mistake and guides the user to wrap the function in a `list()`, e.g. `DT[, new_col := list(mean)]`, if the intent is to create a list-column of functions. Thanks to @tdhock for the report and @venom1204 for the fix.
49+
11. Assigning a raw `function` to a new column, e.g. `DT[, new_col := mean]`, now throws an informative error. This prevents a common mistake and guides the user to wrap the `function` in a `list()`, e.g. `DT[, new_col := list(mean)]`, if the intent is to create a list-column of functions. Thanks to @tdhock for the report and @venom1204 for the fix.
5050

5151
### BUG FIXES
5252

inst/tests/tests.Rraw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21430,4 +21430,4 @@ test(2330.8, as.data.table(list(M), keep.rownames=TRUE), data.table(rn=rep("", 3
2143021430
#5829 checking the RHS of :=
2143121431
DT = data.table(x = 1:3)
2143221432
test(2331.1, DT[, y := mean], error = "RHS of `:=` is a function")
21433-
test(2331.2, DT[, y := list(mean)], error = "RHS of `:=` is a length-1 list containing a function")
21433+
test(2331.2, DT[, y := function(x) x], error = "RHS of `:=` is a function")

0 commit comments

Comments
 (0)