Skip to content

Commit 4c3967e

Browse files
authored
Merge branch 'master' into hindi_s
2 parents 5e2dcd5 + afe1218 commit 4c3967e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+697
-343
lines changed

.Rbuildignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
^Makefile$
2828
^NEWS\.0\.md$
2929
^NEWS\.1\.md$
30-
^_pkgdown\.yml$
3130
^src/Makevars$
3231
^CODEOWNERS$
3332
^GOVERNANCE\.md$
@@ -46,11 +45,11 @@
4645
^.*\.dll$
4746

4847
^bus$
49-
^pkgdown$
5048
^docs$
5149
^lib$
5250
^library$
5351
^devwd$
52+
^site$
5453

5554
# only the inst/po compressed files are needed, not raw .pot/.po
5655
^po$

.ci/linters/c/00preprocess.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.preprocess = function (f) list(
2-
c_obj = f, lines = readLines(f),
2+
path = f, lines = readLines(f),
33
preprocessed = system2(
44
"gcc", shQuote(c("-fpreprocessed", "-E", f)),
55
stdout = TRUE, stderr = FALSE
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* Ensure _RO accessors are used for assignment to 'const' variables */
2+
@@
3+
type T;
4+
const T *variable;
5+
expression E;
6+
@@
7+
- variable = RAW(E)
8+
+ variable = RAW_RO(E)
9+
10+
@@
11+
type T;
12+
const T *variable;
13+
expression E;
14+
@@
15+
- variable = LOGICAL(E)
16+
+ variable = LOGICAL_RO(E)
17+
18+
@@
19+
type T;
20+
const T *variable;
21+
expression E;
22+
@@
23+
- variable = INTEGER(E)
24+
+ variable = INTEGER_RO(E)
25+
26+
@@
27+
type T;
28+
const T *variable;
29+
expression E;
30+
@@
31+
- variable = REAL(E)
32+
+ variable = REAL_RO(E)
33+
34+
@@
35+
type T;
36+
const T *variable;
37+
expression E;
38+
@@
39+
- variable = COMPLEX(E)
40+
+ variable = COMPLEX_RO(E)
41+
42+
/* Just use _RO accessors directly instead of 'const' casting the writeable one */
43+
@@
44+
expression E;
45+
type T;
46+
@@
47+
-(const T*) RAW(E)
48+
+RAW_RO(E)
49+
50+
@@
51+
expression E;
52+
@@
53+
-(const int*) LOGICAL(E)
54+
+LOGICAL_RO(E)
55+
56+
@@
57+
expression E;
58+
@@
59+
-(const int*) INTEGER(E)
60+
+INTEGER_RO(E)
61+
62+
@@
63+
expression E;
64+
@@
65+
-(const double*) REAL(E)
66+
+REAL_RO(E)
67+
@@
68+
expression E;
69+
type T;
70+
@@
71+
-(const T*) COMPLEX(E)
72+
+COMPLEX_RO(E)
73+
74+
@@
75+
expression E;
76+
type T;
77+
@@
78+
-(const T*) STRING_PTR(E)
79+
+STRING_PTR_RO(E)

.github/workflows/code-quality.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
c:
3030
- '**/*.c'
3131
- '**/*.h'
32+
- '.ci/linters/cocci/**/*.cocci'
3233
po:
3334
- 'po/**/*.po'
3435
md:

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,10 @@ dev.R
5757
*.diff
5858
*.patch
5959

60-
# pkgdown
61-
docs
60+
# litedown
61+
site/*.html
62+
site/*.md
63+
site/doc/
64+
site/man/
65+
site/reference/
66+
site/reference_index.rds

.gitlab-ci.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -351,20 +351,32 @@ test-mac-old:
351351
# merging package tarballs and binaries into single R repository
352352
# rendering documentation
353353
# setting up CRAN-like structure
354-
# generating pkgdown website
354+
# generating litedown website
355355
integration:
356356
stage: integration
357-
image: registry.gitlab.com/rdatatable/dockerfiles/r-pkgdown
357+
image: registry.gitlab.com/rdatatable/dockerfiles/r-data.table
358358
tags:
359359
- saas-linux-medium-amd64
360-
only:
361-
- master
360+
rules:
361+
- if: '$CI_COMMIT_REF_NAME == "master"'
362+
- if: '$CI_PIPELINE_SOURCE == "web"'
362363
needs: ["mirror-packages","build","test-lin-rel","test-lin-rel-cran","test-lin-dev-gcc-strict-cran","test-lin-dev-clang-cran","test-lin-rel-vanilla","test-lin-ancient-cran","test-lin-dev-clang-san","test-lin-dev-gcc-san","test-win-rel","test-win-dev" ,"test-win-old","test-mac-rel","test-mac-old"]
363364
script:
364365
- R --version
365-
- *install-deps ## markdown pkg not present in r-pkgdown image
366-
- mkdir -p ./pkgdown/favicon/ && cp .graphics/favicon/* ./pkgdown/favicon/ ## copy favicons
367-
- Rscript -e 'pkgdown::build_site(override=list(destination="./website"))'
366+
- *install-deps ## markdown pkg not present in r-litedown image
367+
## Install data.table from build artifacts (needed by litedown site generation)
368+
- R CMD INSTALL bus/build/data.table_*.tar.gz
369+
## Copy assets to site directory
370+
- mkdir -p ./site/assets/favicon/
371+
- cp .graphics/favicon/* ./site/assets/favicon/
372+
## Generate reference pages first (creates reference_index.rds needed by manual.Rmd)
373+
- Rscript site/generate_reference.R
374+
## Build litedown site (now manual.Rmd can use reference_index.rds)
375+
- cd site && Rscript -e 'litedown::fuse_site()' && cd ..
376+
- mkdir -p website
377+
- cp -r site/*.html website/
378+
- cp -r site/reference website/ 2>/dev/null || true
379+
- cp -r site/assets website/
368380
## html manual, vignettes, repos, cran_web, cran_checks
369381
- echo 'source(".ci/ci.R"); source(".ci/publish.R")' >> .Rprofile
370382
## list of available test-* jobs dynamically based on bus/test-* directories
@@ -436,8 +448,16 @@ integration:
436448
- Rscript -e 'check.index("data.table", names(test.jobs))'
437449
## web/checks/check_flavors.html
438450
- Rscript -e 'check.flavors(names(test.jobs))'
439-
## pkgdown merge
440-
- Rscript -e 'common_files<-function(path1, path2) intersect(list.files(path1, all.files=TRUE, no..=TRUE), list.files(path2, all.files=TRUE, no..=TRUE)); msg = if (length(f<-common_files("website","bus/integration/cran"))) paste(c("Following artifacts will be overwritten by pkgdown artifacts:", paste0(" ", f)), collapse="\n") else "No overlapping files from pkgdown artifacts"; message(msg); q("no")'
451+
## Add backwards compatibility redirects
452+
- mkdir -p website/news website/reference website/articles
453+
- echo '<script>location.replace("../news.html")</script>' > website/news/index.html
454+
- echo '<script>location.replace("../manual.html")</script>' > website/reference/index.html
455+
## Render translated vignettes into articles/<language>
456+
- Rscript site/render_translations.R
457+
## Copy existing vignettes into articles/
458+
- cp -r bus/integration/cran/library/data.table/doc/* website/articles/
459+
## litedown merge
460+
- Rscript -e 'common_files<-function(path1, path2) intersect(list.files(path1, all.files=TRUE, no..=TRUE), list.files(path2, all.files=TRUE, no..=TRUE)); msg = if (length(f<-common_files("website","bus/integration/cran"))) paste(c("Following artifacts will be overwritten by litedown artifacts:", paste0(" ", f)), collapse="\n") else "No overlapping files from litedown artifacts"; message(msg); q("no")'
441461
- mv website/* bus/integration/cran/
442462
## add plausible.io stats
443463
- find bus/integration/cran -type f -iname "*.html" | xargs sed -i 's!<head>!<head><script defer data-domain="rdatatable.gitlab.io/data.table" src="https://plausible.io/js/script.js"></script>!g'
@@ -447,7 +467,6 @@ integration:
447467
# R repository
448468
# test jobs summaries
449469
# html documentation of all packages in repo
450-
# pkgdown website
451470
pages:
452471
stage: deploy
453472
environment: production

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ S3method(split, data.table)
139139
export(dcast, melt)
140140
S3method(dcast, data.table)
141141
S3method(melt, data.table)
142-
S3method(melt, default)
143142

144143
# exported for historical reasons -- if reshape2 is higher on search path,
145144
# dcast(DT) will not dispatch since reshape2::dcast is not generic. So users

NEWS.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## data.table news and updates
1+
# data.table news and updates
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

@@ -30,37 +30,45 @@
3030

3131
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.
3232

33-
2. `set()` now automatically pre-allocates new column slots if needed, similar to what `:=` already does, [#1831](https://github.com/Rdatatable/data.table/issues/1831) [#4100](https://github.com/Rdatatable/data.table/issues/4100). Thanks to @zachokeeffe and @tyner for the report and @ben-schwen for the fix.
33+
2. `fread("file://...")` works for file URIs with spaces, [#7550](https://github.com/Rdatatable/data.table/issues/7550). Thanks @aitap for the report and @MichaelChirico for the PR.
3434

35-
3. `fread("file://...")` works for file URIs with spaces, [#7550](https://github.com/Rdatatable/data.table/issues/7550). Thanks @aitap for the report and @MichaelChirico for the PR.
35+
3. `fread(text=)` could segfault when reading text input ending with a `\x1a` (ASCII SUB) character after a long line, [#7407](https://github.com/Rdatatable/data.table/issues/7407) which is solved by adding check for eof. Thanks @aitap for the report and @manmita for the fix.
3636

37-
4. `sum(<int64 column>)` by group is correct with missing entries and GForce activated ([#7571](https://github.com/Rdatatable/data.table/issues/7571)). Thanks to @rweberc for the report and @manmita for the fix. The issue was caused by a faulty early `break` that spilled between groups, and resulted in silently incorrect results!
37+
4. `rowwiseDT()` now provides a helpful error message when a complex object that is not a list (e.g., a function) is provided as a cell value, instructing the user to wrap it in `list()`, [#7219](https://github.com/Rdatatable/data.table/issues/7219). Thanks @kylebutts for the report and @venom1204 for the fix.
3838

39-
5. `fread(text=)` could segfault when reading text input ending with a `\x1a` (ASCII SUB) character after a long line, [#7407](https://github.com/Rdatatable/data.table/issues/7407) which is solved by adding check for eof. Thanks @aitap for the report and @manmita for the fix.
39+
### Notes
4040

41-
6. `rowwiseDT()` now provides a helpful error message when a complex object that is not a list (e.g., a function) is provided as a cell value, instructing the user to wrap it in `list()`, [#7219](https://github.com/Rdatatable/data.table/issues/7219). Thanks @kylebutts for the report and @venom1204 for the fix.
41+
1. {data.table} now depends on R 3.5.0 (2018).
4242

43-
7. Fixed compilation failure like "error: unknown type name 'siginfo_t'" in v1.18.0 in some strict environments, e.g., FreeBSD, where the header file declaring the POSIX function `waitid` does not transitively include the header file defining the `siginfo_t` type, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix.
43+
2. pydatatable compatibility layer in `fread()` and `fwrite()` has been removed, [#7069](https://github.com/Rdatatable/data.table/issues/7069). Thanks @badasahog for the report and the PR.
4444

45-
8. When fixing duplicate factor levels, `setattr()` no longer crashes upon encountering missing factor values, [#7595](https://github.com/Rdatatable/data.table/issues/7595). Thanks to @sindribaldur for the report and @aitap for the fix.
45+
3. Vignettes are now built using `litedown` instead of `knitr`, [#6394](https://github.com/Rdatatable/data.table/issues/6394). Thanks @jangorecki for the suggestion and @ben-schwen and @aitap for the implementation.
4646

47-
9. `foverlaps()` no longer crashes due to out-of-bounds access to list and integer vectors when `y` has no rows or the non-range part of the join fails, [#7597](https://github.com/Rdatatable/data.table/issues/7597). Thanks to @nextpagesoft for the report and @aitap for the fix.
47+
4. The data.table test suite is a bit more robust to lacking UTF-8 support via a new `requires_utf8` argument to `test()` to skip tests when UTF-8 support is not available, [#7336](https://github.com/Rdatatable/data.table/issues/7336). Thanks @MichaelChirico for the suggestion and @ben-schwen for the implementation.
4848

49-
10. The dynamic library now exports only `R_init_data_table`, preventing symbol name conflicts like `hash_create` with PostgreSQL, [#7605](https://github.com/Rdatatable/data.table/issues/7605). Thanks to @ced75 for the report and @aitap for the fix
49+
5. `melt()` and `dcast()` no longer provide nudges when receiving incompatible inputs (e.g. data.frames). As of now, we only define methods for `data.table` inputs.
5050

51-
### Notes
51+
## data.table [v1.18.2.1](https://github.com/Rdatatable/data.table/milestone/44?closed=1) (22 January 2026)
5252

53-
1. {data.table} now depends on R 3.5.0 (2018).
53+
### BUG FIXES
5454

55-
2. pydatatable compatibility layer in `fread()` and `fwrite()` has been removed, [#7069](https://github.com/Rdatatable/data.table/issues/7069). Thanks @badasahog for the report and the PR.
55+
1. When fixing duplicate factor levels, `setattr()` no longer crashes upon encountering missing factor values, [#7595](https://github.com/Rdatatable/data.table/issues/7595). Thanks to @sindribaldur for the report and @aitap for the fix.
5656

57-
3. Vignettes are now built using `litedown` instead of `knitr`, [#6394](https://github.com/Rdatatable/data.table/issues/6394). Thanks @jangorecki for the suggestion and @ben-schwen and @aitap for the implementation.
57+
2. `foverlaps()` no longer crashes due to out-of-bounds access to list and integer vectors when `y` has no rows or the non-range part of the join fails, [#7597](https://github.com/Rdatatable/data.table/issues/7597). Thanks to @nextpagesoft for the report and @aitap for the fix.
58+
59+
3. The dynamic library now exports only `R_init_data_table`, preventing symbol name conflicts like `hash_create` with PostgreSQL, [#7605](https://github.com/Rdatatable/data.table/issues/7605). Thanks to @ced75 for the report and @aitap for the fix
60+
61+
### Notes
62+
63+
1. Removed use of non-API `ATTRIB`, `SET_ATTRIB`, and `findVar` [#6180](https://github.com/Rdatatable/data.table/issues/6180). Thanks @aitap for the continued assiduous work here, and @MichaelChirico for the easy fix to replace `findVar` with `R_getVar`.
64+
65+
2. Fixed compilation failure like "error: unknown type name 'siginfo_t'" in v1.18.0 in some strict environments, e.g., FreeBSD, where the header file declaring the POSIX function `waitid` does not transitively include the header file defining the `siginfo_t` type, [#7516](https://github.com/rdatatable/data.table/issues/7516). Thanks to @jszhao for the report and @aitap for the fix.
5866

59-
4. Removed use of non-API `ATTRIB`, `SET_ATTRIB`, and `findVar` [#6180](https://github.com/Rdatatable/data.table/issues/6180). Thanks @aitap for the continued assiduous work here, and @MichaelChirico for the easy fix to replace `findVar` with `R_getVar`.
67+
3. `sum(<int64 column>)` by group is correct with missing entries and GForce activated ([#7571](https://github.com/Rdatatable/data.table/issues/7571)). Thanks to @rweberc for the report and @manmita for the fix. The issue was caused by a faulty early `break` that spilled between groups, and resulted in silently incorrect results!
6068

61-
5. The data.table test suite is a bit more robust to lacking UTF-8 support via a new `requires_utf8` argument to `test()` to skip tests when UTF-8 support is not available, [#7336](https://github.com/Rdatatable/data.table/issues/7336). Thanks @MichaelChirico for the suggestion and @ben-schwen for the implementation.
69+
4. `set()` now automatically pre-allocates new column slots if needed, similar to what `:=` already does, [#1831](https://github.com/Rdatatable/data.table/issues/1831) [#4100](https://github.com/Rdatatable/data.table/issues/4100). Thanks to @zachokeeffe and @tyner for the report and @ben-schwen for the fix.
6270

63-
## data.table [v1.18.0](https://github.com/Rdatatable/data.table/milestone/37?closed=1) 23 December 2025
71+
## data.table [v1.18.0](https://github.com/Rdatatable/data.table/milestone/37?closed=1) (23 December 2025)
6472

6573
### BREAKING CHANGE
6674

R/fcast.R

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ dcast = function(
1212
data, formula, fun.aggregate = NULL, ..., margins = NULL,
1313
subset = NULL, fill = NULL, value.var = guess(data)
1414
) {
15-
# TODO(>=1.19.0): Remove this, just let dispatch to 'default' method fail.
16-
if (!is.data.table(data))
17-
stopf("The %1$s generic in data.table has been passed a %2$s, but data.table::%1$s currently only has a method for data.tables. Please confirm your input is a data.table, with setDT(%3$s) or as.data.table(%3$s). If you intend to use a method from reshape2, try installing that package first, but do note that reshape2 is superseded and is no longer actively developed.", "dcast", class1(data), deparse(substitute(data))) # nocov
1815
UseMethod("dcast", data)
1916
}
2017

R/fmelt.R

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ melt = function(data, ..., na.rm = FALSE, value.name = "value") {
77
UseMethod("melt", data)
88
}
99

10-
# TODO(>=1.19.0): Remove this, just let dispatch to 'default' method fail.
11-
melt.default = function(data, ..., na.rm = FALSE, value.name = "value") {
12-
stopf("The %1$s generic in data.table has been passed a %2$s and will attempt to redirect to the relevant reshape2 method; please note that reshape2 is superseded and is no longer actively developed, and this redirection is now deprecated. To continue using melt methods from reshape2 while both packages are attached, e.g. melt.list, you can prepend the namespace, i.e. reshape2::%1$s(%3$s). In the next version, this warning will become an error.", "melt", class1(data), deparse(substitute(data))) # nocov
13-
}
14-
1510
patterns = function(..., cols=character(0L), ignore.case=FALSE, perl=FALSE, fixed=FALSE, useBytes=FALSE) {
1611
# if ... has no names, names(list(...)) will be "";
1712
# this assures they'll be NULL instead

0 commit comments

Comments
 (0)