Skip to content

Commit d39fc1c

Browse files
authored
Merge branch 'master' into issue6846
2 parents 5a3f19c + b70d026 commit d39fc1c

Some content is hidden

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

44 files changed

+341
-161
lines changed

.ci/atime/tests.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ test.list <- atime::atime_test_list(
117117
file.path("src", "init.c"),
118118
paste0("R_init_", Package_regex),
119119
paste0("R_init_", gsub("[.]", "_", new.Package_)))
120+
# allow compilation on new R versions where 'Calloc' is not defined
121+
pkg_find_replace(
122+
file.path("src", "*.c"),
123+
"\\b(Calloc|Free|Realloc)\\b",
124+
"R_\\1")
120125
pkg_find_replace(
121126
"NAMESPACE",
122127
sprintf('useDynLib\\("?%s"?', Package_regex),

.ci/linters/c/alloc_linter.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ alloc_linter = function(c_obj) {
66
lines = c_obj$lines
77
# Be a bit more precise to avoid mentions in comments, and allow
88
# malloc(0) to be used for convenience (e.g. #6757)
9-
alloc_lines = grep(R"{=\s*([(]\w+\s*[*][)])?[mc]alloc[(][^0]}", lines)
9+
alloc_lines = grep(R"{=\s*([(]\s*\w+\s*[*]\s*[)])?\s*[mc]alloc[(][^0]}", lines)
1010
if (!length(alloc_lines)) return()
1111
# int *tmp=(int*)malloc(...); or just int tmp=malloc(...);
1212
alloc_keys = lines[alloc_lines] |>
@@ -31,7 +31,7 @@ alloc_linter = function(c_obj) {
3131
cat("FILE: ", c_obj$path, "; LINES: ", head(bad_lines_idx, 1L), "-", tail(bad_lines_idx, 1L), "\n", sep="")
3232
writeLines(lines[bad_lines_idx])
3333
cat(strrep("-", max(nchar(lines[bad_lines_idx]))), "\n", sep="")
34-
stop("Expected the malloc()/calloc() usage above to be followed immediately by error checking.", call.=FALSE)
34+
stop("Expected the malloc()/calloc() usage above to be followed immediately by error checking (using '!', not '==NULL').", call.=FALSE)
3535
}
3636
})
3737
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@malloc_return_value_cast expression@
2+
type T;
3+
expression E;
4+
@@
5+
- (T)
6+
malloc(E)

.github/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Project members with the Committer role or the CRAN Maintainer role are pledged
2424

2525
Those who prefer to report in a way that is independent of the current Committers and Maintainer may instead contact the Community Engagement Coordinator by e-mailing [r.data.table\@gmail.com](mailto:[email protected]). Messages sent to this e-mail address will be visible only to the current Community Engagement Coordinator, a position always held by an individual who is not a Committer or CRAN Maintainer of the package.
2626

27-
The current Committers are Toby Dylan Hocking (@tdhock), Matt Dowle (@mattdowle), Arun Srinivasan (@arunsrinivasan), Jan Gorecki (@jangorecki), Michael Chirico (@MichaelChirico), and Benjamin Schwendinger (@ben-schwen).
27+
The current Committers are Toby Dylan Hocking (@tdhock), Matt Dowle (@mattdowle), Arun Srinivasan (@arunsrinivasan), Jan Gorecki (@jangorecki), Michael Chirico (@MichaelChirico), Benjamin Schwendinger (@ben-schwen), and Ivan Krylov (@aitap).
2828

2929
The current CRAN Maintainer is Tyson Barrett (@tysonstanley).
3030

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ jobs:
2727
# GHA does run these jobs concurrently but even so reducing the load seems like a good idea.
2828
- {os: windows-latest, r: 'devel'}
2929
# - {os: macOS-latest, r: 'release'} # test-coverage.yaml uses macOS
30-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
31-
# - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
30+
# TODO(remotes>2.5.0): Use 24.04[noble?]
31+
- {os: ubuntu-22.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
32+
# - {os: ubuntu-22.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest", http-user-agent: "R/4.1.0 (ubuntu-22.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
3233
# GLCI covers R-devel; no need to delay contributors in dev due to changes in R-devel in recent days
3334

3435
env:
@@ -64,7 +65,7 @@ jobs:
6465
while read -r cmd
6566
do
6667
eval sudo $cmd
67-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
68+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "22.04"))')
6869
6970
- name: Install dependencies
7071
run: |

CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
/src/programming.c @jangorecki
2424
/vignettes/datatable-programming.Rmd @jangorecki
2525

26+
# roll-up & setops
27+
/R/groupingsets.R @jangorecki
28+
/R/setops.R @jangorecki
29+
2630
# GForce groupby
2731
/src/gsumm.c @ben-schwen
2832
# datetime classes

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,6 @@ Authors@R: c(
100100
person("Vincent", "Rocher", role="ctb"),
101101
person("Vijay", "Lulla", role="ctb"),
102102
person("Aljaž", "Sluga", role="ctb"),
103-
person("Bill", "Evans", role="ctb")
103+
person("Bill", "Evans", role="ctb"),
104+
person("Reino", "Bruner", role="ctb")
104105
)

NEWS.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66

77
1. New `sort_by()` method for data.tables, [#6662](https://github.com/Rdatatable/data.table/issues/6662). It uses `forder()` to improve upon the data.frame method and also match `DT[order(...)]` behavior with respect to locale. Thanks @rikivillalba for the suggestion and PR.
88

9+
2. `melt()` now supports using `patterns()` with `id.vars`, [#6867](https://github.com/Rdatatable/data.table/issues/6867). Thanks to Toby Dylan Hocking for the suggestion and PR.
10+
11+
3. `print.data.table()` now shows column classes at the bottom of large tables when `class=TRUE` and `col.names="auto"` (default) for tables with more than 20 rows, [#6902](https://github.com/Rdatatable/data.table/issues/6902). This follows the same behavior as column names at the bottom, making it easier to see column types for large tables without scrolling back to the top. Thanks to @TimTaylor for the suggestion and @Mukulyadav2004 for the PR.
12+
13+
4. `as.Date()` method for `IDate` no longer coerces to `double` [#6922](https://github.com/Rdatatable/data.table/issues/6922). Thanks @MichaelChirico for the report and PR. The only effect should be on overly-strict tests that assert `Date` objects have `double` storage, which is not in general true, especially from R 4.5.0.
14+
915
## BUG FIXES
1016

1117
1. Custom binary operators from the `lubridate` package now work with objects of class `IDate` as with a `Date` subclass, [#6839](https://github.com/Rdatatable/data.table/issues/6839). Thanks @emallickhossain for the report and @aitap for the fix.
@@ -14,7 +20,15 @@
1420

1521
3. `fread(keepLeadingZeros=TRUE)` now correctly parses dates with components with leading zeros as dates instead of strings, [#6851](https://github.com/Rdatatable/data.table/issues/6851). Thanks @TurnaevEvgeny for the report and @ben-schwen for the fix.
1622

17-
4. `as.data.table()` now properly handles keys: specifying keys sets them, omitting keys preserves existing ones, and setting `key=NULL` clears them, [#6859](https://github.com/Rdatatable/data.table/issues/6859). Thanks @brookslogan for the report and @Mukulyadav2004 for the fix.
23+
4. `as.data.table()` now properly handles keys: specifying keys sets them, omitting keys preserves existing ones, and setting `key=NULL` clears them. Additionally, `keep.rownames` is now consistently passed to `as.data.table(x, keep.rownames)`, [#6859](https://github.com/Rdatatable/data.table/issues/6859). Thanks @brookslogan for the report and @Mukulyadav2004 for the fix.
24+
25+
5. `as.data.table()` on `x` avoids an infinite loop if the output of the corresponding `as.data.frame()` method has the same class as the input, [#6874](https://github.com/Rdatatable/data.table/issues/6874). Concretely, we had `class(x) = c('foo', 'data.frame')` and `class(as.data.frame(x)) = c('foo', 'data.frame')`, so `as.data.frame.foo` wound up getting called repeatedly. Thanks @matschmitz for the report and @ben-schwen for the fix.
26+
27+
6. By-reference sub-assignments to factor columns now match the levels in UTF-8, preventing their duplication when the same level exists in different encodings, [#6886](https://github.com/Rdatatable/data.table/issues/6886). Thanks @iagogv3 for the report and @aitap for the fix.
28+
29+
7. `fwrite()` now avoids a crash when translating strings into a different encoding, [#6883](https://github.com/Rdatatable/data.table/issues/6883). Thanks @filipemsc for the report and @aitap for the fix.
30+
31+
8. `fread()` no longer warns on certain systems on R 4.5.0+ where the file owner can't be resolved, [#6918](https://github.com/Rdatatable/data.table/issues/6918). Thanks @ProfFancyPants for the report and PR.
1832

1933
## NOTES
2034

R/IDateTime.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ as.IDate.POSIXct = function(x, tz = attr(x, "tzone", exact=TRUE), ...) {
4646
as.IDate.IDate = function(x, ...) x
4747

4848
as.Date.IDate = function(x, ...) {
49-
x = as.numeric(x)
5049
class(x) = "Date"
5150
x
5251
}

R/as.data.table.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,12 @@ as.data.table.list = function(x,
215215

216216
as.data.table.data.frame = function(x, keep.rownames=FALSE, key=NULL, ...) {
217217
if (is.data.table(x)) return(as.data.table.data.table(x, key=key)) # S3 is weird, #6739. Also # nocov; this is tested in 2302.{2,3}, not sure why it doesn't show up in coverage.
218-
if (!identical(class(x), "data.frame")) return(as.data.table(as.data.frame(x), keep.rownames=keep.rownames, key=key, ...))
218+
if (!identical(class(x), "data.frame")) {
219+
class_orig = class(x)
220+
x = as.data.frame(x)
221+
if (identical(class(x), class_orig)) setattr(x, "class", "data.frame") # cater for cases when as.data.frame can generate a loop #6874
222+
return(as.data.table.data.frame(x, keep.rownames=keep.rownames, key=key, ...))
223+
}
219224
if (!isFALSE(keep.rownames)) {
220225
# can specify col name to keep.rownames, #575; if it's the same as key,
221226
# kludge it to 'rn' since we only apply the new name afterwards, #4468

0 commit comments

Comments
 (0)