You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,8 @@
105
105
106
106
4. The default `format_list_item()` method (and hence `print.data.table()`) annotates truncated list items with their length, [#605](https://github.com/Rdatatable/data.table/issues/605). Thanks Matt Dowle for the original report (2012!) and @MichaelChirico for the fix.
107
107
108
+
5. A GitHub Actions workflow is now in place to warn the entire maintainer team, as well as any contributor following the GitHub repository, when the package is at risk of archival on CRAN [#7008](https://github.com/Rdatatable/data.table/issues/7008). Thanks @tdhock for the original report and @Bisaloo and @TysonStanley for the fix.
109
+
108
110
# data.table [v1.17.8](https://github.com/Rdatatable/data.table/milestone/41) (6 July 2025)
109
111
110
112
1. Internal functions used to signal errors are now marked as non-returning, silencing a compiler warning about potentially unchecked allocation failure. Thanks to Prof. Brian D. Ripley for the report and @aitap for the fix, [#7070](https://github.com/Rdatatable/data.table/pull/7070).
stopf("Incompatible join types: %s (%s) and %s (%s). Factor columns must join to factor or character columns.", xname, x_merge_type, iname, i_merge_type)
93
+
stopf("Incompatible join types: %s (%s) and %s (%s). Factor columns must join to factor or character columns.", xname, x_merge_type, iname, i_merge_type, class="dt_join_type_mismatch_error")
94
94
}
95
95
if (x_merge_type==i_merge_type) {
96
96
if (verbose) catf("%s has same type (%s) as %s. No coercion needed.\n", iname, x_merge_type, xname)
} else stopf("Incompatible join types: %s is type integer64 but %s is type double and cannot be coerced to integer64 (e.g. has fractions)", nm[2L], nm[1L])
117
+
} else stopf("Incompatible join types: %s is type integer64 but %s is type double and cannot be coerced to integer64 (e.g. has fractions)", nm[2L], nm[1L], class="dt_join_type_mismatch_error")
118
118
} else {
119
119
# just integer and double left
120
120
ic_idx= which(icol==icols) # check if on is joined on multiple conditions, #6602
if (".xi" %chin% names(x)) stopf("x contains a column called '.xi'. Conflicts with internal use by data.table.")
55
55
for (iincols) {
56
56
.xi=x[[i]] # [[ is copy on write, otherwise checking type would be copying each column
57
-
if (!typeof(.xi) %chin% ORDERING_TYPES) stopf("Column '%s' is type '%s' which is not supported as a key column type, currently.", i, typeof(.xi))
57
+
if (!typeof(.xi) %chin% ORDERING_TYPES) stopf("Column '%s' is type '%s' which is not supported as a key column type, currently.", i, typeof(.xi), class="dt_unsortable_type_error")
58
58
}
59
59
if (!is.character(cols) || length(cols)<1L) internal_error("'cols' should be character at this point") # nocov
if (any(miss)) stopf("some columns are not in the data.table: %s", brackify(cols[miss]))
269
+
if (any(miss)) stopf("some columns are not in the data.table: %s", brackify(cols[miss]), class="dt_missing_column_error")
270
270
if (".xi" %chin% colnames(x)) stopf("x contains a column called '.xi'. Conflicts with internal use by data.table.")
271
271
for (iincols) {
272
272
.xi=x[[i]] # [[ is copy on write, otherwise checking type would be copying each column
273
-
if (!typeof(.xi) %chin% ORDERING_TYPES) stopf("Column '%s' is type '%s' which is not supported for ordering currently.", i, typeof(.xi))
273
+
if (!typeof(.xi) %chin% ORDERING_TYPES) stopf("Column '%s' is type '%s' which is not supported for ordering currently.", i, typeof(.xi), class="dt_unsortable_type_error")
274
274
}
275
275
if (!is.character(cols) || length(cols)<1L) internal_error("'cols' should be character at this point") # nocov
if ( is.character(x[[rc]]) &&!(is.character(y[[lc]]) || is.factor(y[[lc]])) ) {
17
-
stopf("When x's column ('%s') is character, the corresponding column in y ('%s') should be factor or character, but found incompatible type '%s'.", xcnam, icnam, typeof(y[[lc]]))
17
+
stopf("When x's column ('%s') is character, the corresponding column in y ('%s') should be factor or character, but found incompatible type '%s'.", xcnam, icnam, typeof(y[[lc]]), class="dt_join_type_mismatch_error")
stopf("When x's column ('%s') is factor, the corresponding column in y ('%s') should be character or factor, but found incompatible type '%s'.", xcnam, icnam, typeof(y[[lc]]))
19
+
stopf("When x's column ('%s') is factor, the corresponding column in y ('%s') should be character or factor, but found incompatible type '%s'.", xcnam, icnam, typeof(y[[lc]]), class="dt_join_type_mismatch_error")
stopf("When x's column ('%s') is integer or numeric, the corresponding column in y ('%s') can not be character or logical types, but found incompatible type '%s'.", xcnam, icnam, typeof(y[[lc]]))
21
+
stopf("When x's column ('%s') is integer or numeric, the corresponding column in y ('%s') can not be character or logical types, but found incompatible type '%s'.", xcnam, icnam, typeof(y[[lc]]), class="dt_join_type_mismatch_error")
22
22
}
23
23
}
24
24
ux= unique(shallow(x, by.x))
@@ -52,7 +52,7 @@ funique = function(x) {
52
52
}
53
53
if (!identical(sx<-sapply(x, super), sy<-sapply(y, super))) {
54
54
w= which.first(sx!=sy)
55
-
stopf("Item %d of x is '%s' but the corresponding item of y is '%s'.", w, class1(x[[w]]), class1(y[[w]]))
55
+
stopf("Item %d of x is '%s' but the corresponding item of y is '%s'.", w, class1(x[[w]]), class1(y[[w]]), class="dt_join_type_mismatch_error")
56
56
}
57
57
if (.seqn&&".seqn" %chin% names(x)) stopf("None of the datasets should contain a column named '.seqn'")
\code{data.table} providesspecificconditionclassesforcommonoperations, makingiteasiertohandleconditionsprogrammatically.Thisisparticularlyusefulwhenwritingrobustcodeorpackagesthatuse \code{data.table}.Relyingontheexacttextofconditionmessagesis fragile (itisnotuncommontochangethewordingslightly, orfortheuser's session not to be in English); prefer using the signal class where possible.
6
+
}
7
+
\details{
8
+
\subsection{Available Condition Classes}{
9
+
\code{data.table} provides the following specific condition classes:
10
+
11
+
Error Classes:
12
+
\itemize{
13
+
\item \code{dt_missing_column_error}: When referencing columns that don'texist
AllconditionclassesinheritfrombaseR's condition system, so existing \code{tryCatch(..., error = ...)} code continues to work unchanged. The new classes simply provide more specific handling options when needed.
0 commit comments