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
@@ -133,6 +133,8 @@ rowwiseDT(
133
133
134
134
19. An integer overflow in `fread()` with lines longer than `2^(31/2)` bytes is prevented, [#6729](https://github.com/Rdatatable/data.table/issues/6729). The typical impact was no worse than a wrong initial allocation size, corrected later. Thanks to @TaikiSan21 for the report and @aitap for the fix.
135
135
136
+
20. Fixed a memory issue causing segfaults in `forder`, [#6797](https://github.com/Rdatatable/data.table/issues/6797). Thanks @dkutner for the report and @MichaelChirico for the fix.
137
+
136
138
## NOTES
137
139
138
140
1. There is a new vignette on joins! See `vignette("datatable-joins")`. Thanks to Angel Feliz for authoring it! Feedback welcome. This vignette has been highly requested since 2017: [#2181](https://github.com/Rdatatable/data.table/issues/2181).
plural_part<- sprintf(ngettext(length(tt), "The item in the 'by' or 'keyby' list is length %s.", "The items in the 'by' or 'keyby' list have lengths %s."), brackify(tt))
896
-
stopf("%s Each must be length %d; the same length as there are rows in x (after subsetting if i is provided).", plural_part, xnrow)
895
+
stopf(ngettext(length(tt),
896
+
"The item in the 'by' or 'keyby' list is length %s. Each must be length %d; the same length as there are rows in x (after subsetting if i is provided).",
897
+
"The items in the 'by' or 'keyby' list have lengths %s. Each must be length %d; the same length as there are rows in x (after subsetting if i is provided)."),
898
+
brackify(tt), xnrow, domain=NA)
897
899
}
898
900
if (is.null(bynames)) bynames= rep.int("",length(byval))
899
901
if (length(idx<- which(!nzchar(bynames))) &&!bynull) {
Copy file name to clipboardExpand all lines: R/onAttach.R
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@
27
27
if (gettext("TRANSLATION CHECK") !="TRANSLATION CHECK") {
28
28
packageStartupMessagef(
29
29
"**********\nRunning data.table in English; package support is available in English only. When searching for online help, be sure to also check for the English error message. This can be obtained by looking at the po/R-<locale>.po and po/<locale>.po files in the package source, where the native language and English error messages can be found side-by-side.%s\n**********",
30
-
if (exists('Sys.setLanguage', envir=baseenv())) " You can also try calling Sys.setLanguage('en') prior to reproducing the error message."else""
30
+
if (exists('Sys.setLanguage', envir=baseenv())) gettext(" You can also try calling Sys.setLanguage('en') prior to reproducing the error message.")else""
cat("getDTthreads(verbose=TRUE):\n") # for tracing on CRAN; output to log before anything is attempted
113
+
cat("getDTthreads(verbose=TRUE):\n") #notranslate: for tracing on CRAN; output to log before anything is attempted
114
114
getDTthreads(verbose=TRUE) # includes the returned value in the verbose output (rather than dangling '[1] 4'); e.g. "data.table is using 4 threads"
115
115
catf("test.data.table() running: %s\n", fn) # print fn to log before attempting anything on it (in case it is missing); on same line for slightly easier grep
@@ -334,10 +336,6 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no
334
336
Sys.unsetenv(names(old)[!is_preset])
335
337
}, add=TRUE)
336
338
}
337
-
if (!is.null(options)) {
338
-
old_options<- do.call(base::options, as.list(options)) # as.list(): allow passing named character vector for convenience
339
-
on.exit(base::options(old_options), add=TRUE)
340
-
}
341
339
# Usage:
342
340
# i) tests that x equals y when both x and y are supplied, the most common usage
343
341
# ii) tests that x is TRUE when y isn't supplied
@@ -376,14 +374,18 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no
376
374
if (memtest==1L) gc() # see #5515 for before/after
377
375
inum= as.integer(num)
378
376
timings[inum, RSS:=max(rss(),RSS), verbose=FALSE] # TODO prefix inum with .. for clarity when that works
379
-
if (length(memtest.id) &&memtest.id[1L]<=inum&&inum<=memtest.id[2L]) cat(rss(),"\n") # after 'testing id ...' output; not using between() as it has verbose output when getOption(datatable.verbose)
377
+
if (length(memtest.id) &&memtest.id[1L]<=inum&&inum<=memtest.id[2L]) cat(rss(),"\n") #notranslate. after 'testing id ...' output; not using between() as it has verbose output when getOption(datatable.verbose)
380
378
if (memtest==2L) gc()
381
379
}
382
380
assign("lasttime", proc.time()[3L], parent.frame(), inherits=TRUE) # after gc() to exclude gc() time from next test when memtest
383
381
}, add=TRUE )
384
-
if (showProgress)
385
-
# \r can't be in gettextf msg
386
-
cat("\rRunning test id", numStr, "") # nocov.
382
+
if (showProgress) {
383
+
# nocov start
384
+
cat("\r") # notranslate: \r can't be in gettextf msg
385
+
catf("Running test id %s", numStr)
386
+
cat("") # notranslate
387
+
# nocov end
388
+
}
387
389
# See PR #4090 for comments about change here in Dec 2019.
388
390
# If a segfault error occurs in future and we'd like to know after which test, then arrange for the
389
391
# try(sys.source()) in test.data.table() to be run in a separate R process. That process could write out
@@ -422,13 +424,23 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no
for (msginignore.warning) observed= grep(msg, observed, value=TRUE, invert=TRUE) # allow multiple for translated messages rather than relying on '|' to always work
450
462
}
451
-
if (length(expected) != length(observed)) {
463
+
if (length(expected) != length(observed)&& (!foreign|| is.null(ignore.warning))) {
452
464
# nocov start
453
465
catf("Test %s produced %d %ss but expected %d\n%s\n%s\n", numStr, length(observed), type, length(expected), paste("Expected:", expected), paste("Observed:", observed, collapse="\n"))
454
466
fail=TRUE
455
467
# nocov end
456
-
} else {
468
+
} elseif (!foreign) {
457
469
# the expected type occurred and, if more than 1 of that type, in the expected order
458
470
for (iin seq_along(expected)) {
459
-
if (!foreign&&!string_match(expected[i], observed[i])) {
471
+
if (!string_match(expected[i], observed[i])) {
460
472
# nocov start
461
473
catf("Test %s didn't produce the correct %s:\nExpected: %s\nObserved: %s\n", numStr, type, expected[i], observed[i])
462
474
fail=TRUE
@@ -475,7 +487,8 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no
475
487
if (out[length(out)] =="NULL") out=out[-length(out)]
476
488
out= paste(out, collapse="\n")
477
489
output= paste(output, collapse="\n") # so that output= can be either a \n separated string, or a vector of strings.
478
-
if (length(output) &&!string_match(output, out)) {
490
+
# it also happens to turn off the 'y' checking branch below
491
+
if (length(output) &&!foreign&&!string_match(output, out)) {
479
492
# nocov start
480
493
catf("Test %s did not produce correct output:\n", numStr)
481
494
catf("Expected: <<%s>>\n", encodeString(output)) # \n printed as '\\n' so the two lines of output can be compared vertically
@@ -487,7 +500,7 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no
487
500
fail=TRUE
488
501
# nocov end
489
502
}
490
-
if (length(notOutput) && string_match(notOutput, out, ignore.case=TRUE)) {
503
+
if (length(notOutput) &&!foreign&&string_match(notOutput, out, ignore.case=TRUE)) {
491
504
# nocov start
492
505
catf("Test %s produced output but should not have:\n", numStr)
0 commit comments