Skip to content

Commit

Permalink
Merge branch 'master' into old-include-only
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Jul 13, 2024
2 parents 6ad7639 + 9fbdea5 commit 669248f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/R-CMD-check-occasional.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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
5 changes: 5 additions & 0 deletions R/data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
1 change: 1 addition & 0 deletions R/test.data.table.R
Original file line number Diff line number Diff line change
Expand Up @@ -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="")

Expand Down
5 changes: 4 additions & 1 deletion inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -18388,10 +18388,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))
Expand Down
3 changes: 1 addition & 2 deletions man/fread.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}
Expand Down
3 changes: 0 additions & 3 deletions src/data.table.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Rinternals.h>
#define SEXPPTR_RO(x) ((const SEXP *)DATAPTR_RO(x)) // to avoid overhead of looped STRING_ELT and VECTOR_ELT
#include <stdint.h> // for uint64_t rather than unsigned long long
Expand Down
2 changes: 1 addition & 1 deletion src/dogroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ SEXP dogroups(SEXP dt, SEXP dtcols, SEXP groups, SEXP grpcols, SEXP jiscols, SEX
for (int j=0; j<LENGTH(jval); ++j) {
thiscol = VECTOR_ELT(jval,j);
if (isNull(thiscol)) continue;
if (!isVector(thiscol) || isDataFrame(thiscol))
if (!isVector(thiscol) || isFrame(thiscol))
error(_("Entry %d for group %d in j=list(...) should be atomic vector or list. If you are trying something like j=list(.SD,newcol=mean(colA)) then use := by group instead (much quicker), or cbind or merge afterwards."), j+1, i+1);
if (isArray(thiscol)) {
SEXP dims = PROTECT(getAttrib(thiscol, R_DimSymbol));
Expand Down

0 comments on commit 669248f

Please sign in to comment.