Skip to content

Commit 1593221

Browse files
Bump R dependency to 3.4.0 (#6975)
* Bump R dependency to 3.4.0 * rm declaration of routine * remove registration too
1 parent 7620b46 commit 1593221

File tree

19 files changed

+37
-92
lines changed

19 files changed

+37
-92
lines changed

.ci/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Test jobs:
1212
- `test-lin-rel-cran` - `--as-cran` on Linux, strict test for final status of `R CMD check`.
1313
- `test-lin-dev-gcc-strict-cran` - `--as-cran` on Linux, `r-devel` built with `-enable-strict-barrier --disable-long-double`, test for compilation warnings, test for new NOTEs/WARNINGs from `R CMD check`.
1414
- `test-lin-dev-clang-cran` - same as `gcc-strict` job but R built with `clang` and no `--enable-strict-barrier --disable-long-double` flags.
15-
- `test-lin-ancient-cran` - Stated R dependency version (currently 3.3.0) on Linux.
15+
- `test-lin-ancient-cran` - Stated R dependency version (currently 3.4.0) on Linux.
1616
- `test-lin-dev-san` - `r-devel` on Linux built with `clang -fsanitize=address,undefined` (including LeakSanitizer), test for sanitizer output in tests and examples.
1717
- `test-win-rel` - `r-release` on Windows.
1818
- `test-win-dev` - `r-devel` on Windows.

.dev/CRAN_Release.cmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,23 +235,23 @@ system.time(test.data.table(script="*.Rraw")) # apx 8h = froll 3h + nafill 1m +
235235

236236

237237
###############################################
238-
# R 3.3.0 (stated dependency)
238+
# R 3.4.0 (stated dependency)
239239
###############################################
240240

241241
### ONE TIME BUILD
242242
sudo apt-get -y build-dep r-base
243243
cd ~/build
244-
wget http://cran.stat.ucla.edu/src/base/R-3/R-3.3.0.tar.gz
245-
tar xvf R-3.3.0.tar.gz
246-
cd R-3.3.0
244+
wget http://cran.stat.ucla.edu/src/base/R-3/R-3.4.0.tar.gz
245+
tar xvf R-3.4.0.tar.gz
246+
cd R-3.4.0
247247
CFLAGS="-fcommon" FFLAGS="-fallow-argument-mismatch" ./configure --without-recommended-packages
248248
make
249-
alias R330=~/build/R-3.3.0/bin/R
249+
alias R340=~/build/R-3.4.0/bin/R
250250
### END ONE TIME BUILD
251251

252252
cd ~/GitHub/data.table
253-
R330 CMD INSTALL ./data.table_1.16.99.tar.gz
254-
R330
253+
R340 CMD INSTALL ./data.table_1.16.99.tar.gz
254+
R340
255255
require(data.table)
256256
test.data.table(script="*.Rraw")
257257

.devcontainer/r-ancient-gcc/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.gitlab.com/jangorecki/dockerfiles/r-3.3.0
1+
FROM registry.gitlab.com/jangorecki/dockerfiles/r-3.4.0
22

33
RUN apt-get -qq update \
44
&& apt-get install -y --no-install-recommends git

.github/workflows/R-CMD-check-occasional.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [macOS-latest, windows-latest, ubuntu-latest]
18-
r: ['devel', 'release', '3.3', '3.4', '3.5', '3.6', '4.0', '4.1', '4.2', '4.3']
18+
r: ['devel', 'release', '3.4', '3.5', '3.6', '4.0', '4.1', '4.2', '4.3']
1919
locale: ['en_US.utf8', 'zh_CN.utf8', 'lv_LV.utf8'] # Chinese for translations, Latvian for collate order (#3502)
2020
exclude:
2121
# only run non-English locale CI on Ubuntu
@@ -28,8 +28,6 @@ jobs:
2828
- os: windows-latest
2929
locale: 'lv_LV.utf8'
3030
# macOS/arm64 only available for R>=4.1.0
31-
- os: macOS-latest
32-
r: '3.3'
3331
- os: macOS-latest
3432
r: '3.4'
3533
- os: macOS-latest

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ test-lin-dev-clang-cran:
203203
# stated dependency on R
204204
test-lin-ancient-cran:
205205
<<: *test-lin
206-
image: registry.gitlab.com/rdatatable/dockerfiles/r-3.3.0
206+
image: registry.gitlab.com/rdatatable/dockerfiles/r-3.4.0
207207
variables:
208208
_R_CHECK_FORCE_SUGGESTS_: "FALSE" # can be removed if all dependencies are available (knitr, xts, etc.)
209209
script:
210210
- *install-deps
211211
# knitr requires evaluate, which requires R 3.6.0.
212-
# Restore checking vignettes if upgrading our R dependency means knitr can be installed.
212+
# Restore checking vignettes if upgrading our R dependency means knitr can be installed, or when we switch to litedown.
213213
- R CMD check --no-manual --no-build-vignettes --ignore-vignettes $(ls -1t data.table_*.tar.gz | head -n 1)
214214

215215
# run the main checks with Address(+Leak),UBSanitizer enabled

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: data.table
22
Version: 1.17.99
33
Title: Extension of `data.frame`
4-
Depends: R (>= 3.3.0)
4+
Depends: R (>= 3.4.0)
55
Imports: methods
66
Suggests: bit64 (>= 4.0.0), bit (>= 4.0.4), R.utils, xts, zoo (>= 1.8-1), yaml, knitr, markdown
77
Description: Fast aggregation of large data (e.g. 100GB in RAM), fast ordered joins, fast add/modify/delete of columns by group using no copies at all, list columns, friendly and fast character-separated-value read/write. Offers a natural and flexible syntax, for faster development.

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
+ Argument `in.place` to `droplevels` has been removed.
4242
+ It's now an error to set `datatable.nomatch`, which has been warning since 1.15.0.
4343

44+
3. {data.table} now depends on R 3.4.0 (2017).
45+
4446
# data.table [v1.17.0](https://github.com/Rdatatable/data.table/milestone/34) (20 Feb 2025)
4547

4648
## POTENTIALLY BREAKING CHANGES

R/onAttach.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
else
4040
packageStartupMessagef("This is %s. This warning should not normally occur on Windows or Linux where OpenMP is turned on by data.table's configure script by passing -fopenmp to the compiler. If you see this warning on Windows or Linux, please file a GitHub issue.\n**********", Sys.info()["sysname"])
4141
}
42-
if (.Call(CbeforeR340)) {
43-
# not base::getRversion()<"3.4.0" in case the user upgrades R but does not reinstall data.table; a reasonable mistake since data.table would seem to be the latest version
44-
packageStartupMessagef("**********\nThis data.table installation was compiled for R < 3.4.0 (Apr 2017) and is known to leak memory. Please upgrade R and reinstall data.table to fix the leak. Maintaining and testing code branches to support very old versions increases development time so please do upgrade R. We intend to bump data.table's dependency from 8 year old R 3.1.0 (Apr 2014) to 5 year old R 3.4.0 (Apr 2017).\n**********")
45-
}
4642
}
4743
}
4844

R/print.data.table.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ char.trunc = function(x, trunc.char = getOption("datatable.prettyprint.char")) {
253253
nchar_chars = nchar(x, 'char')
254254
is_full_width = nchar_width > nchar_chars
255255
idx = !is.na(x) & pmin(nchar_width, nchar_chars) > trunc.char
256-
if (!any(idx)) return(x) # strtrim() errors for width=integer() on R 3.3.0
257256
x[idx] = paste0(strtrim(x[idx], trunc.char * fifelse(is_full_width[idx], 2L, 1L)), "...")
258257
x
259258
}

inst/tests/tests.Rraw

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,6 @@ base_messages = list(
200200
NULL
201201
)
202202

203-
# Ensure an operation uses C-locale sorting (#3502). For test set-ups/comparisons that use base operations, which are
204-
# susceptible to locale-specific sorting issues, but shouldn't be needed for data.table code, which always uses C sorting.
205-
# TODO(R>=3.3.0): use order(method="radix") as a way to avoid needing this helper
206-
with_c_collate = function(expr) {
207-
old = Sys.getlocale("LC_COLLATE")
208-
on.exit(Sys.setlocale("LC_COLLATE", old))
209-
Sys.setlocale("LC_COLLATE", "C")
210-
expr
211-
}
212-
213203
##########################
214204
.do_not_rm = ls() # objects that exist at this point should not be removed by rm_all(); e.g. test_*, base_messages, Ctest_dt_win_snprintf, prevtest, etc
215205
##########################
@@ -1841,10 +1831,10 @@ test(609, chorder(character()), base::order(character()))
18411831
test(610, chorder(""), base::order(""))
18421832
# Extra tests of chorder and chgroup
18431833
x = sample(LETTERS)
1844-
test(610.1, chorder(x), with_c_collate(base::order(x)))
1834+
test(610.1, chorder(x), base::order(x, method="radix"))
18451835
test(610.2, chgroup(x), seq_along(x))
18461836
x = sample(LETTERS,1000,replace=TRUE)
1847-
test(610.3, chorder(x), with_c_collate(base::order(x)))
1837+
test(610.3, chorder(x), base::order(x, method="radix"))
18481838
test(610.4, unique(x[chgroup(x)]), unique(x))
18491839

18501840
# := by group
@@ -4516,7 +4506,9 @@ for (nvars in seq_along(names(DT))) {
45164506
combn(names(DT), nvars, simplify=FALSE, function(x) { # simplify=FALSE needed for R 3.1.0
45174507
for (i in seq_len(nrow(signs))) {
45184508
test_no <<- test_no + 1L
4519-
ll = as.call(c(as.name("order"),
4509+
ll = as.call(c(
4510+
as.name("order"),
4511+
method="radix",
45204512
lapply(seq_along(x), function(j) {
45214513
if (signs[i,j] == 1L)
45224514
as.name(x[j])
@@ -4528,7 +4520,7 @@ for (nvars in seq_along(names(DT))) {
45284520
}
45294521
})
45304522
))
4531-
test(1223.0 + test_no*0.001, forderv(DT, by=x, order=signs[i,]), with_c_collate(with(DT, eval(ll))))
4523+
test(1223.0 + test_no*0.001, forderv(DT, by=x, order=signs[i,]), with(DT, eval(ll)))
45324524
}
45334525
integer()
45344526
})
@@ -4609,18 +4601,8 @@ test(1240.2, ans2, ans1)
46094601
# i.e. a three-way match.
46104602
base_order <- function(..., na.last=TRUE, method=c("shell","radix")) {
46114603
ans1 = base::order(..., na.last=na.last, method="shell")
4612-
if (!is.na(na.last) || base::getRversion()>"3.3.3") {
4613-
ans2 = base::order(..., na.last=na.last, method="radix")
4614-
if (!identical(ans1,ans2)) stop("Base R's order(,method='shell') != order(,method='radix')")
4615-
} else {
4616-
# Only when na.last=NA in just R 3.3.0-3.3.3 we don't check shell==radix
4617-
# because there was a problem in base R's port of data.table code then when :
4618-
# 1) 2 or more vectors were passed to base::order(,method="radix")
4619-
# AND 2) na.last=NA
4620-
# AND 3) there is a subgroup of size exactly 2
4621-
# AND 4) one of those 2 items in the subgroup is NA and the other is not NA
4622-
# See tests 1728.3 and 1728.13.
4623-
}
4604+
ans2 = base::order(..., na.last=na.last, method="radix")
4605+
if (!identical(ans1, ans2)) stop("Base R's order(,method='shell') != order(,method='radix')")
46244606
ans1
46254607
}
46264608

@@ -4780,7 +4762,9 @@ for (i in seq_along(names(DT))) {
47804762
ans[[i]] = combn(names(DT), i, function(x) {
47814763
tmp = apply(cj, 1, function(y) {
47824764
test_no <<- test_no + 1L
4783-
ll = as.call(c(as.name("base_order"),
4765+
ll = as.call(c(
4766+
as.name("base_order"),
4767+
method = "radix",
47844768
lapply(seq_along(x), function(j) {
47854769
if (y[j] == 1L)
47864770
as.name(x[j])
@@ -4793,11 +4777,11 @@ for (i in seq_along(names(DT))) {
47934777
})
47944778
))
47954779
ans1 = forderv(DT, by=x, order=y, na.last=TRUE) # adding tests for both nalast=TRUE and nalast=NA
4796-
test(1252.0 + test_no*0.001, ans1, with_c_collate(with(DT, eval(ll))))
4780+
test(1252.0 + test_no*0.001, ans1, with(DT, eval(ll)))
47974781
test_no <<- test_no + 1L
47984782
ll <- as.call(c(as.list(ll), na.last=NA))
47994783
ans1 = forderv(DT, by=x, order=y, na.last=NA) # nalast=NA here.
4800-
test(1252.0 + test_no*0.001, ans1[ans1 != 0], with_c_collate(with(DT, eval(ll))))
4784+
test(1252.0 + test_no*0.001, ans1[ans1 != 0], with(DT, eval(ll)))
48014785
})
48024786
dim(tmp)=NULL
48034787
list(tmp)
@@ -12402,10 +12386,7 @@ DT1 = data.table(x = mixed_strings, y = c(latin1_strings, utf8_strings), z = 1:1
1240212386
DT2 = copy(DT1)
1240312387
setkey(DT1, x)
1240412388
setkey(DT2, y)
12405-
# the ans is generated by `sort(c(utf8_strings, utf8_strings), method = "radix")`
12406-
# but we should not use radix sort in the test because it's introduced after R3.3.0
12407-
ans = c("El. pa\u00c5\u00a1tas", "El. pa\u00c5\u00a1tas", "fa\u00e7ile", "fa\u00e7ile",
12408-
"\u00a1tas", "\u00a1tas", "\u00de", "\u00de", "\u00e7ile", "\u00e7ile")
12389+
ans = sort(c(utf8_strings, utf8_strings), method = "radix")
1240912390
test(1864.1, DT1$x, ans)
1241012391
test(1864.2, DT2$y, ans)
1241112392
ans = c(1L, 6L, 2L, 7L, 3L, 8L, 4L, 9L, 5L, 10L)
@@ -17789,12 +17770,9 @@ x = factor(letters[1:10])
1778917770
DT = data.table(a = x)[1:5]
1779017771
test(2214.01, fdroplevels(factor()), droplevels(factor()))
1779117772
test(2214.02, fdroplevels(x[1:5]), droplevels(x[1:5]))
17792-
if (base::getRversion() >= "3.4.0") {
17793-
# bug fix in R 3.4.0: "droplevels(f) now keeps <NA> levels when present."
17794-
test(2214.03, fdroplevels(x[1:5], c("b", "d")), droplevels(x[1:5], c("b", "d")))
17795-
test(2214.04, fdroplevels(x[1:5], letters[1:5]), droplevels(x[1:5], letters[1:5]))
17796-
test(2214.05, droplevels(DT, exclude=c("b", "d"))[["a"]], droplevels(DT[1:5,a], c("b", "d")))
17797-
}
17773+
test(2214.03, fdroplevels(x[1:5], c("b", "d")), droplevels(x[1:5], c("b", "d")))
17774+
test(2214.04, fdroplevels(x[1:5], letters[1:5]), droplevels(x[1:5], letters[1:5]))
17775+
test(2214.05, droplevels(DT, exclude=c("b", "d"))[["a"]], droplevels(DT[1:5,a], c("b", "d")))
1779817776
test(2214.06, droplevels(DT)[["a"]], droplevels(DT[1:5,a]))
1779917777
test(2214.07, droplevels(DT, 1)[["a"]], x[1:5])
1780017778
# 2214.08 was of defunct in.place argument

0 commit comments

Comments
 (0)