Skip to content

Commit e2de9c0

Browse files
committed
type-> class
1 parent 3ece463 commit e2de9c0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
108108
18. `fwrite` now allows `dec` to be the same as `sep` for edge cases where only one will be written, e.g. 0-row or 1-column tables. [#7227](https://github.com/Rdatatable/data.table/issues/7227). Thanks @MichaelChirico for the report and @venom1204 for the fix.
109109
110+
19. `rowwiseDT()` now provides a helpful error message when a complex object that is not a list (e.g., a function) is provided as a cell value, instructing the user to wrap it in `list()`. [#7219](https://github.com/Rdatatable/data.table/issues/7219). Thanks @kylebutts for the report and @venom1204 for the fix.
111+
110112
### NOTES
111113
112114
1. The following in-progress deprecations have proceeded:

R/rowwiseDT.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ rowwiseDT = function(...) {
2121
first_problem_idx = which(is_problematic)[1L]
2222
col_idx = (first_problem_idx - 1L) %% ncols + 1L
2323
col_name = header[col_idx]
24-
obj_type = typeof(body[[first_problem_idx]])
24+
obj_type = class(body[[first_problem_idx]])[1L]
2525
stopf(
26-
"In column '%s', received an object of type '%s'.\nComplex objects (like functions, models, etc.) must be wrapped in list() to be stored in a data.table column.\nPlease use `list(...)` for this value.",
26+
"In column '%s', received an object of type '%s'.\nComplex objects (like functions, formulas, or calls) must be wrapped in list() to be stored in a data.table column.\nPlease use `list(...)` for this value.",
2727
col_name,
2828
obj_type
2929
)

0 commit comments

Comments
 (0)