Skip to content

Commit cc4e1f1

Browse files
committed
Merge branch 'master' into fread_skip_none
2 parents 138dac1 + 0acfe94 commit cc4e1f1

29 files changed

+901
-808
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.4.0) on Linux.
15+
- `test-lin-ancient-cran` - Stated R dependency version (currently 3.5.0) on Linux.
1616
- `test-lin-dev-clang-san` - `r-devel` on Linux built with `clang -fsanitize=address,undefined` (including LeakSanitizer), test for sanitizer output in tests and examples.
1717
- `test-lin-dev-gcc-san` - `r-devel` on Linux built with `gcc -fsanitize=address,undefined` (including LeakSanitizer), test for sanitizer output in tests and examples.
1818
- `test-win-rel` - `r-release` on Windows.

.dev/CRAN_Release.cmd

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ rm -rf ./data.table.Rcheck
4747

4848
checkbashisms ./configure # for portability; e.g. Solaris 10 running Bourne shell; #3964
4949

50-
# Ensure no non-ASCII, other than in README.md is ok
50+
# Ensure no non-ASCII, other than in README.md DESCRIPTION vignettes *.yml and *.po are ok
5151
# tests.Rraw in particular have failed CRAN Solaris (only) due to this.
52-
grep -RI --exclude-dir=".git" --exclude="*.md" --exclude="*~" --color='auto' -P -n "[\x80-\xFF]" ./
52+
grep -RI --exclude-dir=".git" --exclude-dir="vignettes" --exclude="*.yml" --exclude="*.md" --exclude="*.po" --exclude="*~" --exclude="DESCRIPTION" --color='auto' -P -n "[\x80-\xFF]" ./
5353

5454
# Unicode is now ok. This unicode in tests.Rraw is passing on CRAN.
55-
grep -RI --exclude-dir=".git" --exclude="*.md" --exclude="*~" --color='auto' -n "[\]u[0-9]" ./
55+
# grep -RI --exclude-dir=".git" --exclude="*.md" --exclude="*~" --color='auto' -n "[\]u[0-9]" ./
5656

5757
# Ensure no calls to omp_get_max_threads() also since access should be via getDTthreads()
5858
grep --exclude="./src/openmp-utils.c" omp_get_max_threads ./src/*
@@ -80,14 +80,14 @@ grep "Rprintf" ./src/init.c
8080
# workaround for IBM AIX - ensure no globals named 'nearest' or 'class'.
8181
# See https://github.com/Rdatatable/data.table/issues/1351
8282
grep "nearest *=" ./src/*.c # none
83-
grep "class *=" ./src/*.c # quite a few but none global
83+
grep "class *=" ./src/*.c # only one
8484

8585
# ensure no use of z_const from zconf.h; #3939
8686
grep "z_const" ./src/*.[hc] # none other than the comment
8787

8888
# No undefined type punning of the form: *(long long *)&REAL(column)[i]
8989
# Failed clang 3.9.1 -O3 due to this, I think.
90-
grep "&REAL" ./src/*.c
90+
grep "&REAL" ./src/*.c # one instance in init.c
9191

9292
# No [UN]PROTECT_PTR, #3232
9393
grep "PROTECT_PTR" ./src/*.c
@@ -107,13 +107,13 @@ grep -n "[^A-Za-z0-9]F[^A-Za-z0-9]" ./inst/tests/tests.Rraw
107107
grep -Enr "\bifelse" R
108108

109109
# use substr() instead of substring(), #4447
110-
grep -Fnr "substring" R
110+
grep -Fnr "substring" R # one instance in test.data.table.R
111111

112112
# No system.time in main tests.Rraw. Timings should be in benchmark.Rraw
113-
grep -Fn "system.time" ./inst/tests/*.Rraw | grep -Fv "benchmark.Rraw" | grep -Fv "this system.time usage ok"
113+
grep -Fn "system.time" ./inst/tests/*.Rraw | grep -Fv "benchmark.Rraw" | grep -Fv "this system.time usage ok" # only in froll.Rraw
114114

115115
# No tryCatch in *.Rraw -- tryCatch should be handled only in test() itself to avoid silently missed warnings/errors/output
116-
grep -Fn "tryCatch" ./inst/tests/*.Rraw
116+
grep -Fn "tryCatch" ./inst/tests/*.Rraw # only one outside of test() ./inst/tests/tests.Rraw:21594
117117

118118
# All % in *.Rd should be escaped otherwise text gets silently chopped
119119
grep -n "[^\]%" ./man/*.Rd
@@ -168,8 +168,8 @@ R CMD build .
168168
export GITHUB_PAT="f1c.. github personal access token ..7ad"
169169
# avoids many too-many-requests in --as-cran's ping-all-URLs step (20 mins) inside the `checking CRAN incoming feasibility...` step.
170170
# Many thanks to Dirk for the tipoff that setting this env variable solves the problem, #4832.
171-
R CMD check data.table_1.16.99.tar.gz --as-cran
172-
R CMD INSTALL data.table_1.16.99.tar.gz --html
171+
R CMD check data.table_1.18.99.tar.gz --as-cran
172+
R CMD INSTALL data.table_1.18.99.tar.gz --html
173173

174174
# Test C locale doesn't break test suite (#2771)
175175
echo LC_ALL=C > ~/.Renviron
@@ -193,9 +193,9 @@ q("no")
193193

194194
# User supplied PKG_CFLAGS and PKG_LIBS passed through, #4664
195195
# Next line from https://mac.r-project.org/openmp/. Should see the arguments passed through and then fail with gcc on linux.
196-
PKG_CFLAGS='-Xclang -fopenmp' PKG_LIBS=-lomp R CMD INSTALL data.table_1.16.99.tar.gz
196+
PKG_CFLAGS='-Xclang -fopenmp' PKG_LIBS=-lomp R CMD INSTALL data.table_1.18.99.tar.gz
197197
# Next line should work on Linux, just using superfluous and duplicate but valid parameters here to see them retained and work
198-
PKG_CFLAGS='-fopenmp' PKG_LIBS=-lz R CMD INSTALL data.table_1.16.99.tar.gz
198+
PKG_CFLAGS='-fopenmp' PKG_LIBS=-lz R CMD INSTALL data.table_1.18.99.tar.gz
199199

200200
R
201201
remove.packages("xml2") # we checked the URLs; don't need to do it again (many minutes)
@@ -224,23 +224,23 @@ system.time(test.data.table(script="*.Rraw")) # apx 8h = froll 3h + nafill 1m +
224224

225225

226226
###############################################
227-
# R 3.4.0 (stated dependency)
227+
# R 3.5.0 (stated dependency)
228228
###############################################
229229

230230
### ONE TIME BUILD
231231
sudo apt-get -y build-dep r-base
232232
cd ~/build
233-
wget http://cran.stat.ucla.edu/src/base/R-3/R-3.4.0.tar.gz
234-
tar xvf R-3.4.0.tar.gz
235-
cd R-3.4.0
233+
wget http://cran.stat.ucla.edu/src/base/R-3/R-3.5.0.tar.gz
234+
tar xvf R-3.5.0.tar.gz
235+
cd R-3.5.0
236236
CFLAGS="-fcommon" FFLAGS="-fallow-argument-mismatch" ./configure --without-recommended-packages
237237
make
238-
alias R340=~/build/R-3.4.0/bin/R
238+
alias R350=~/build/R-3.5.0/bin/R
239239
### END ONE TIME BUILD
240240

241241
cd ~/GitHub/data.table
242-
R340 CMD INSTALL ./data.table_1.16.99.tar.gz
243-
R340
242+
R350 CMD INSTALL ./data.table_1.18.99.tar.gz
243+
R350
244244
require(data.table)
245245
test.data.table(script="*.Rraw")
246246

@@ -251,15 +251,15 @@ test.data.table(script="*.Rraw")
251251
vi ~/.R/Makevars
252252
# Make line SHLIB_OPENMP_CFLAGS= active to remove -fopenmp
253253
R CMD build .
254-
R CMD INSTALL data.table_1.16.99.tar.gz # ensure that -fopenmp is missing and there are no warnings
254+
R CMD INSTALL data.table_1.18.99.tar.gz # ensure that -fopenmp is missing and there are no warnings
255255
R
256256
require(data.table) # observe startup message about no OpenMP detected
257257
test.data.table()
258258
q("no")
259259
vi ~/.R/Makevars
260260
# revert change above
261261
R CMD build .
262-
R CMD check data.table_1.16.99.tar.gz
262+
R CMD check data.table_1.18.99.tar.gz
263263

264264

265265
#####################################################
@@ -568,7 +568,7 @@ du -k inst/tests # 0.75MiB after
568568
R CMD build .
569569
export GITHUB_PAT="f1c.. github personal access token ..7ad"
570570
Rdevel -q -e "packageVersion('xml2')" # ensure installed
571-
Rdevel CMD check data.table_1.17.0.tar.gz --as-cran # use latest Rdevel as it may have extra checks
571+
Rdevel CMD check data.table_1.18.0.tar.gz --as-cran # use latest Rdevel as it may have extra checks
572572
bunzip2 inst/tests/*.Rraw.bz2 # decompress *.Rraw again so as not to commit compressed *.Rraw to git
573573

574574
#
@@ -596,12 +596,12 @@ bunzip2 inst/tests/*.Rraw.bz2 # decompress *.Rraw again so as not to commit com
596596
# 0. Start a new branch `cran-x.y.0` with the code as submitted to CRAN
597597
# - Check that 'git status' shows 4 files in modified and uncommitted state: DESCRIPTION, NEWS.md, init.c and this .dev/CRAN_Release.cmd
598598
# - The branch should have one commit with precisely these 4 files being edited
599-
# 1. Follow up with a commit with this consistent commit message like: "1.17.0 on CRAN. Bump to 1.17.99" to this branch bumping to the next dev version
599+
# 1. Follow up with a commit with this consistent commit message like: "1.18.0 on CRAN. Bump to 1.18.99" to this branch bumping to the next dev version
600600
# - Bump minor version in DESCRIPTION to next odd number. Note that DESCRIPTION was in edited and uncommitted state so even number never appears in git.
601601
# - Add new heading in NEWS for the next dev version. Add "(submitted to CRAN on <today>)" on the released heading.
602602
# - Bump minor version in dllVersion() in init.c
603603
# - Bump 3 minor version numbers in Makefile
604-
# - Search and replace this .dev/CRAN_Release.cmd to update 1.16.99 to 1.16.99 inc below, 1.16.0 to 1.17.0 above, 1.15.0 to 1.16.0 below
604+
# - Search and replace this .dev/CRAN_Release.cmd to update 1.17.99 to 1.18.99 inc below, 1.17.0 to 1.18.0
605605
# - Another final gd to view all diffs using meld. (I have `alias gd='git difftool &> /dev/null'` and difftool meld: http://meldmerge.org/)
606606
# 2. Ideally, no PRs are reviewed while a CRAN submission is pending. Any reviews that do happen MUST target this branch, NOT master!
607607
# 3. Once the submission lands on CRAN, merge this branch WITHOUT SQUASHING!

.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/rdatatable/dockerfiles/r-3.4.0
1+
FROM registry.gitlab.com/rdatatable/dockerfiles/r-3.5.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
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
os: [macOS-latest, windows-latest, ubuntu-latest]
19-
r: ['devel', 'release', '3.4', '3.5', '3.6', '4.0', '4.1', '4.2', '4.3']
19+
r: ['devel', 'release', '3.5', '3.6', '4.0', '4.1', '4.2', '4.3']
2020
locale: ['en_US.utf8', 'zh_CN.utf8', 'lv_LV.utf8'] # Chinese for translations, Latvian for collate order (#3502)
2121
exclude:
2222
# only run non-English locale CI on Ubuntu
@@ -29,8 +29,6 @@ jobs:
2929
- os: windows-latest
3030
locale: 'lv_LV.utf8'
3131
# macOS/arm64 only available for R>=4.1.0
32-
- os: macOS-latest
33-
r: '3.4'
3432
- os: macOS-latest
3533
r: '3.5'
3634
- os: macOS-latest

.gitlab-ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ variables:
1010
_R_CHECK_NO_STOP_ON_TEST_ERROR_: "true"
1111
_R_CHECK_SYSTEM_CLOCK_: "false" ## https://stackoverflow.com/questions/63613301/r-cmd-check-note-unable-to-verify-current-time
1212
_R_CHECK_TESTS_NLINES_: "0"
13-
TZ: "UTC" ## to avoid 'Failed to create bus connection' from timedatectl via Sys.timezone() on Docker with R 3.4.
14-
## Setting TZ for all GLCI jobs to isolate them from timezone. We could have a new GLCI job to test under
13+
TZ: "UTC" ## Setting TZ for all GLCI jobs to isolate them from timezone. We could have a new GLCI job to test under
1514
## a non-UTC timezone, although, that's what we do routinely in dev.
1615
RUN_ALL_DATATABLE_TESTS: "yes" ## run optional tests in CI
1716
R_REL_VERSION: "4.5" # only raise when RTOOLS for REL is available
@@ -49,9 +48,6 @@ mirror-packages:
4948
cache:
5049
paths:
5150
- bus/$CI_JOB_NAME/cran
52-
variables:
53-
# TODO(R-ancient>=3.5.0): remove this; let it save PACKAGES.rds in version-3 format
54-
R_DEFAULT_SERIALIZE_VERSION: 2
5551
script:
5652
- echo 'source(".ci/ci.R")' >> .Rprofile
5753
- mkdir -p bus/$CI_JOB_NAME/cran/src/contrib
@@ -211,7 +207,7 @@ test-lin-dev-clang-cran:
211207
# stated dependency on R
212208
test-lin-ancient-cran:
213209
<<: *test-lin
214-
image: registry.gitlab.com/rdatatable/dockerfiles/r-3.4.0
210+
image: registry.gitlab.com/rdatatable/dockerfiles/r-3.5.0
215211
variables:
216212
_R_CHECK_FORCE_SUGGESTS_: "FALSE" # can be removed if all dependencies are available (knitr, xts, etc.)
217213
script:

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: data.table
2-
Version: 1.17.99
2+
Version: 1.18.99
33
Title: Extension of `data.frame`
4-
Depends: R (>= 3.4.0)
4+
Depends: R (>= 3.5.0)
55
Imports: methods
66
Suggests: bit64 (>= 4.0.0), bit (>= 4.0.4), R.utils (>= 2.13.0), 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.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ some:
1818

1919
.PHONY: clean
2020
clean:
21-
$(RM) data.table_1.17.99.tar.gz
21+
$(RM) data.table_1.18.99.tar.gz
2222
$(RM) src/*.o
2323
$(RM) src/*.so
2424

@@ -28,7 +28,7 @@ build:
2828

2929
.PHONY: install
3030
install:
31-
$(R) CMD INSTALL data.table_1.17.99.tar.gz
31+
$(R) CMD INSTALL data.table_1.18.99.tar.gz
3232

3333
.PHONY: uninstall
3434
uninstall:
@@ -40,7 +40,7 @@ test:
4040

4141
.PHONY: check
4242
check:
43-
_R_CHECK_CRAN_INCOMING_REMOTE_=false $(R) CMD check data.table_1.17.99.tar.gz --as-cran --ignore-vignettes --no-stop-on-test-error
43+
_R_CHECK_CRAN_INCOMING_REMOTE_=false $(R) CMD check data.table_1.18.99.tar.gz --as-cran --ignore-vignettes --no-stop-on-test-error
4444

4545
.PHONY: revision
4646
revision:

NEWS.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22

33
**If you are viewing this file on CRAN, please check [latest news on GitHub](https://github.com/Rdatatable/data.table/blob/master/NEWS.md) where the formatting is also better.**
44

5-
## data.table [v1.17.99](https://github.com/Rdatatable/data.table/milestone/35) (in development)
5+
## data.table [v1.18.99](https://github.com/Rdatatable/data.table/milestone/37?closed=1) (in development)
6+
7+
### Notes
8+
9+
1. {data.table} now depends on R 3.5.0 (2018).
10+
11+
### BUG FIXES
12+
13+
1. `fread()` with `skip=0` and `(header=TRUE|FALSE)` no longer skips the first row when it has fewer fields than subsequent rows, [#7463](https://github.com/Rdatatable/data.table/issues/7463). Thanks @emayerhofer for the report and @ben-schwen for the fix.
14+
15+
## data.table [v1.18.0](https://github.com/Rdatatable/data.table/milestone/37?closed=1) 23 December 2025
616

717
### BREAKING CHANGE
818

@@ -11,6 +21,7 @@
1121
2. `melt()` returns an integer column for `variable` when `measure.vars` is a list of length=1, consistent with the documented behavior, [#5209](https://github.com/Rdatatable/data.table/issues/5209). Thanks to @tdhock for reporting. Any users who were relying on this behavior can change `measure.vars=list("col_name")` (output `variable` was column name, now is column index/integer) to `measure.vars="col_name"` (`variable` still is column name). This change has been planned since 1.16.0 (25 Aug 2024).
1222

1323
3. Rolling functions `frollmean` and `frollsum` distinguish `Inf`/`-Inf` from `NA` to match the same rules as base R when `algo="fast"` (previously they were considered the same). If your input into those functions has `Inf` or `-Inf` then you will be affected by this change. As a result, the argument that controls the handling of `NA`s has been renamed from `hasNA` to `has.nf` (_has non-finite_). `hasNA` continues to work with a warning, for now.
24+
1425
```r
1526
## before
1627
frollsum(c(1,2,3,Inf,5,6), 2)
@@ -19,8 +30,10 @@
1930
## now
2031
frollsum(c(1,2,3,Inf,5,6), 2)
2132
#[1] NA 3 5 Inf Inf 11
33+
```
2234

2335
4. `frollapply` result is not coerced to numeric anymore. Users' code could possibly break if it depends on forced coercion of input/output to numeric type.
36+
2437
```r
2538
## before
2639
frollapply(c(F,T,F,F,F,T), 2, any)
@@ -30,6 +43,7 @@
3043
frollapply(c(F,T,F,F,F,T), 2, any)
3144
#[1] NA TRUE TRUE FALSE FALSE TRUE
3245
```
46+
3347
Additionally argument names in `frollapply` has been renamed from `x` to `X` and `n` to `N` to avoid conflicts with common argument names that may be passed to `...`, aligning to base R API of `lapply`. `x` and `n` continue to work with a warning, for now.
3448
3549
5. Negative and missing values of `n` argument of adaptive rolling functions trigger an error.
@@ -218,6 +232,7 @@ See [#2611](https://github.com/Rdatatable/data.table/issues/2611) for details. T
218232
```
219233

220234
18. New helper `frolladapt` to facilitate applying rolling functions over windows of fixed calendar-time width in irregularly-spaced data sets, thereby bypassing the need to "augment" such data with placeholder rows, [#3241](https://github.com/Rdatatable/data.table/issues/3241). Thanks to @jangorecki for implementation.
235+
221236
```r
222237
idx = as.Date("2025-09-05") + c(0,4,7,8,9,10,12,13,17)
223238
dt = data.table(index=idx, value=seq_along(idx))
@@ -354,7 +369,7 @@ See [#2611](https://github.com/Rdatatable/data.table/issues/2611) for details. T
354369

355370
27. `dogroups()` no longer reads beyond the resized end of over-allocated data.table list columns, [#7486](https://github.com/Rdatatable/data.table/issues/7486). While this didn't crash in practice, it is now explicitly checked for in recent R versions (r89198+). Thanks @TimTaylor and @aitap for the report and @aitap for the fix.
356371

357-
28. `fread()` with `skip=0` and `(header=TRUE|FALSE)` no longer skips the first row when it has fewer fields than subsequent rows, [#7463](https://github.com/Rdatatable/data.table/issues/7463). Thanks @emayerhofer for the report and @ben-schwen for the fix.
372+
28. `rbindlist()` now avoids the crash when working with many non-UTF-8 column names, [#7452](https://github.com/Rdatatable/data.table/issues/7452). Thanks @aitap for the report and the fix.
358373

359374
### NOTES
360375

R/IDateTime.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ chooseOpsMethod.IDate = function(x, y, mx, my, cl, reverse) inherits(y, "Date")
124124
if ( is.double(e2) && !fitsInInt32(e2) ) {
125125
# IDate deliberately doesn't support fractional days so revert to base Date
126126
return(base::`-.Date`(as.Date(e1), e2))
127-
# can't call base::.Date directly (last line of base::`-.Date`) as tried in PR#3168 because
128-
# i) ?.Date states "Internal objects in the base package most of which are only user-visible because of the special nature of the base namespace."
129-
# ii) .Date was newly exposed in R some time after 3.4.4
127+
# can't call base::.Date directly (last line of base::`-.Date`) as tried in PR#3168 because ?.Date states "Internal objects in the base package most of which are only user-visible because of the special nature of the base namespace."
130128
}
131129
ans = as.integer(unclass(e1) - unclass(e2))
132130
if (inherits(e2, "Date")) {

R/as.data.table.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ as.data.table.array = function(x, keep.rownames=FALSE, key=NULL, sorted=TRUE, va
102102
lapply(dx, seq_len)
103103
} else if (any(nulldnx <- vapply_1b(dnx, is.null))) {
104104
dnx[nulldnx] = lapply(dx[nulldnx], seq_len) #3636
105+
setattr(dnx, 'names', copy(names(dnx)))
105106
dnx
106-
} else dnx
107+
} else copy(dnx)
107108
setfrev(val)
108109
if (is.null(names(val)) || !any(nzchar(names(val))))
109110
setattr(val, 'names', paste0("V", frev(seq_along(val))))

0 commit comments

Comments
 (0)