From 01537ee2abf0f8fbd8593a6fd9ed037bbbeda950 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 12 Jul 2024 10:28:11 -0700 Subject: [PATCH 1/7] Missing PROTECT() on new SEXP --- src/fmelt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmelt.c b/src/fmelt.c index 502e576e0..5ffce38e0 100644 --- a/src/fmelt.c +++ b/src/fmelt.c @@ -247,7 +247,7 @@ SEXP checkVars(SEXP DT, SEXP id, SEXP measure, Rboolean verbose) { if (length(value_col)) Rprintf(_("Assigned 'measure.vars' are [%s].\n"), concat(dtnames, value_col)); } } else if (isNull(id) && !isNull(measure)) { - SEXP measure_int_or_list = cols_to_int_or_list(measure, dtnames, true); + SEXP measure_int_or_list = PROTECT(cols_to_int_or_list(measure, dtnames, true)); protecti++; idcols = PROTECT(uniq_diff(measure_int_or_list, ncol, true)); protecti++; if (isNewList(measure)) valuecols = measure_int_or_list; else { From 3c3baa9277e990df0121b4f5e0287271086502bf Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 12 Jul 2024 10:29:32 -0700 Subject: [PATCH 2/7] manual revert commit directly to master to go through PR process --- src/fmelt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmelt.c b/src/fmelt.c index 5ffce38e0..502e576e0 100644 --- a/src/fmelt.c +++ b/src/fmelt.c @@ -247,7 +247,7 @@ SEXP checkVars(SEXP DT, SEXP id, SEXP measure, Rboolean verbose) { if (length(value_col)) Rprintf(_("Assigned 'measure.vars' are [%s].\n"), concat(dtnames, value_col)); } } else if (isNull(id) && !isNull(measure)) { - SEXP measure_int_or_list = PROTECT(cols_to_int_or_list(measure, dtnames, true)); protecti++; + SEXP measure_int_or_list = cols_to_int_or_list(measure, dtnames, true); idcols = PROTECT(uniq_diff(measure_int_or_list, ncol, true)); protecti++; if (isNewList(measure)) valuecols = measure_int_or_list; else { From b390fd32a2855b66b2baa0d0de5871ec5164329b Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 12 Jul 2024 15:02:12 -0700 Subject: [PATCH 3/7] Try an explicit R_LIBS_USER to avoid losing packages between steps (#6251) --- .github/workflows/R-CMD-check-occasional.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/R-CMD-check-occasional.yaml b/.github/workflows/R-CMD-check-occasional.yaml index ce53a4d89..2d0c62dde 100644 --- a/.github/workflows/R-CMD-check-occasional.yaml +++ b/.github/workflows/R-CMD-check-occasional.yaml @@ -1,6 +1,6 @@ on: schedule: - - cron: '17 13 12 * *' # 12th of month at 13:17 UTC + - cron: '17 13 13 * *' # 13th of month at 13:17 UTC # A more complete suite of checks to run monthly; each PR/merge need not pass all these, but they should pass before CRAN release name: R-CMD-check-occasional @@ -42,6 +42,7 @@ jobs: r: '4.1' env: + R_LIBS_USER: /home/runner/work/r-lib R_REMOTES_NO_ERRORS_FROM_WARNINGS: true GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -157,5 +158,5 @@ jobs: if: failure() uses: actions/upload-artifact@main with: - name: ${{ runner.os }}-r${{ matrix.r }}-results + name: ${{ runner.os }}-r${{ matrix.r }}-l${{ matrix.locale }}results path: check From 9e6ea19f1dd9ce37a0e699978ab9b1b727796577 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 12 Jul 2024 16:12:28 -0700 Subject: [PATCH 4/7] Revert "Updating C API Entry Points: isFrame -> isDataFrame (#6235)" (#6252) This reverts commit b5ef7ce04e4c9ac15b2e59babb3c92e58fe02bf8. --- src/data.table.h | 3 --- src/dogroups.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/data.table.h b/src/data.table.h index 024f32b80..ee4a55d3a 100644 --- a/src/data.table.h +++ b/src/data.table.h @@ -10,9 +10,6 @@ #if !defined(R_VERSION) || R_VERSION < R_Version(3, 4, 0) # define SET_GROWABLE_BIT(x) // #3292 #endif -#if !defined(R_VERSION) || R_VERSION < R_Version(4, 5, 0) -# define isDataFrame(x) isFrame(x) -#endif #include #define SEXPPTR_RO(x) ((const SEXP *)DATAPTR_RO(x)) // to avoid overhead of looped STRING_ELT and VECTOR_ELT #include // for uint64_t rather than unsigned long long diff --git a/src/dogroups.c b/src/dogroups.c index 2a5c19e8f..da9a7da17 100644 --- a/src/dogroups.c +++ b/src/dogroups.c @@ -276,7 +276,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX for (int j=0; j Date: Fri, 12 Jul 2024 21:13:03 -0400 Subject: [PATCH 5/7] fix names_sd rev dep issue 6033 (#6238) * fix names_sd rev dev issue 6033 * Simplify test and improve comment about version * remove trailing ws * revdev->revdep --------- Co-authored-by: Benjamin Schwendinger Co-authored-by: Michael Chirico Co-authored-by: Michael Chirico --- R/data.table.R | 5 +++++ inst/tests/tests.Rraw | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/R/data.table.R b/R/data.table.R index 5d31cce54..133c987fe 100644 --- a/R/data.table.R +++ b/R/data.table.R @@ -1121,6 +1121,11 @@ replace_dot_alias = function(e) { if (is.name(lhs)) { lhs = as.character(lhs) } else { + #6033 revdep. Slowly deprecate in 1.17.0. Caller has given us `dt[, substitute(names(.SD))]` which means + # jsub is actually substitute(names(.SD)) instead of just names(.SD) + if (lhs %iscall% 'substitute') + lhs = eval(lhs, parent.frame(), parent.frame()) + # lhs is e.g. (MyVar) or get("MyVar") or names(.SD) || setdiff(names(.SD), cols) lhs = eval(lhs, list(.SD = setNames(logical(length(sdvars)), sdvars)), parent.frame()) } diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index d114d000c..b02063075 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -18383,10 +18383,13 @@ test(2250.11, dt[, names(.SD(2)) := lapply(.SD, .I)], error=base_messages$missin dt = data.table(a = 1:3, b = 5:7, grp = c('a', 'a', 'b')) test(2250.12, dt[, names(.SD) := lapply(.SD, function(x) x + b), .SDcols = "a"], data.table(a = 1:3 + 5:7, b = 5:7, grp = c('a', 'a', 'b'))) - dt = data.table(a = 1L, b = 2L, c = 3L, d = 4L, e = 5L, f = 6L) test(2250.13, dt[, names(.SD)[1:5] := sum(.SD)], data.table(a = 21L, b = 21L, c = 21L, d = 21L, e = 21L, f = 6L)) +dt = data.table(a = 1) #6033 revdep follow-up +my_col = "a" +test(2250.14, dt[, substitute(my_col) := .(3)], data.table(a = 3)) + # fread(...,fill) can also be used to specify a guess on the maximum number of columns #2691 #1812 #4130 #3436 #2727 dt_str = paste(rep(c("1,2\n", "1,2,3\n"), each=100), collapse="") ans = data.table(1L, 2L, rep(c(NA, 3L), each=100L)) From cbd656463b0ac6a516dc734c24641d13322def3d Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 12 Jul 2024 18:48:56 -0700 Subject: [PATCH 6/7] Add .libPaths() to the test.data.table() diagnostic (#6250) --- R/test.data.table.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/test.data.table.R b/R/test.data.table.R index ac991a870..d12ac7166 100644 --- a/R/test.data.table.R +++ b/R/test.data.table.R @@ -235,6 +235,7 @@ test.data.table = function(script="tests.Rraw", verbose=FALSE, pkg=".", silent=F ", Sys.getlocale()=='", Sys.getlocale(), "'", ", l10n_info()=='", paste0(names(l10n_info()), "=", l10n_info(), collapse="; "), "'", ", getDTthreads()=='", paste(gsub("[ ][ ]+","==",gsub("^[ ]+","",capture.output(invisible(getDTthreads(verbose=TRUE))))), collapse="; "), "'", + ", .libPaths()==", paste0("'", .libPaths(), "'", collapse = ","), ", ", .Call(Cdt_zlib_version), "\n", sep="") From 9fbdea5f5017de5ac44d8b1df6ad5e7714882317 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Fri, 12 Jul 2024 18:53:11 -0700 Subject: [PATCH 7/7] remove two broken URLs (#6246) --- man/fread.Rd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/man/fread.Rd b/man/fread.Rd index 64122341c..4448b482b 100644 --- a/man/fread.Rd +++ b/man/fread.Rd @@ -129,7 +129,6 @@ When \code{input} begins with http://, https://, ftp://, ftps://, or file://, \c Background :\cr \url{https://cran.r-project.org/doc/manuals/R-data.html}\cr \url{https://stackoverflow.com/questions/1727772/quickly-reading-very-large-tables-as-dataframes-in-r}\cr -\url{https://cerebralmastication.com/2009/11/loading-big-data-into-r/}\cr \url{https://stackoverflow.com/questions/9061736/faster-than-scan-with-rcpp}\cr \url{https://stackoverflow.com/questions/415515/how-can-i-read-and-manipulate-csv-file-data-in-c}\cr \url{https://stackoverflow.com/questions/9352887/strategies-for-reading-in-csv-files-in-pieces}\cr @@ -141,7 +140,7 @@ Background :\cr finagler = "to get or achieve by guile or manipulation" \url{https://dictionary.reference.com/browse/finagler} -On YAML, see \url{https://yaml.org/}; on csvy, see \url{https://csvy.org/}. +On YAML, see \url{https://yaml.org/}. } \seealso{ \code{\link[utils:read.table]{read.csv}}, \code{\link[base:connections]{url}}, \code{\link[base:locales]{Sys.setlocale}}, \code{\link{setDTthreads}}, \code{\link{fwrite}}, \href{https://CRAN.R-project.org/package=bit64}{\code{bit64::integer64}}