You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .ci/atime/tests.R
+40-4Lines changed: 40 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,14 @@ for(retGrp_chr in c("T","F"))extra.test.list[[sprintf(
64
64
# - seconds.limit: The maximum median timing (in seconds) of an expression. No timings for larger N are computed past that threshold. Default of 0.01 seconds should be sufficient for most tests.
65
65
# - Historical references (short version name = commit SHA1).
66
66
# For historical regressions, use version names 'Before', 'Regression', and 'Fixed'
67
-
# When there was no regression, use 'Slow' and 'Fast'
67
+
# When there was no regression, use 'Slow' and 'Fast'
68
+
# - Caveat: atime installs each version as a separate package but runs them all in ONE R session.
69
+
# State registered outside a package's own namespace therefore persists across versions and can
70
+
# mask a regression. The clearest case is S3 methods for base group generics (Ops, Math, Summary)
71
+
# and helpers like chooseOpsMethod: these register into the base namespace's S3 table
72
+
# (get(".__S3MethodsTable__.", envir = baseenv())), which is shared. If one version registers such
73
+
# a method, it stays active while a version that lacks it is measured. When a test depends on
74
+
# such state, reset it inside `expr` to match the version under test (see the #7213 test below).
68
75
# @note Please check https://github.com/tdhock/atime/blob/main/vignettes/data.table.Rmd for more information.
Fast="680b5e8e6d3f16a09dfb2f86ac7b2ce5ce70c3f1", # Merge commit in the PR (https://github.com/Rdatatable/data.table/pull/4501/commits) that fixes the issue
339
-
Slow="3ca83738d70d5597d9e168077f3768e32569c790", # Circa 2024 master parent of close-to-last merge commit (https://github.com/Rdatatable/data.table/commit/353dc7a6b66563b61e44b2fa0d7b73a0f97ca461) in the PR (https://github.com/Rdatatable/data.table/pull/4501/commits) that fixes the issue
345
+
Fast="680b5e8e6d3f16a09dfb2f86ac7b2ce5ce70c3f1", # Merge commit in the PR (https://github.com/Rdatatable/data.table/pull/4501/commits) that fixes the issue
346
+
Slow="3ca83738d70d5597d9e168077f3768e32569c790", # Circa 2024 master parent of close-to-last merge commit (https://github.com/Rdatatable/data.table/commit/353dc7a6b66563b61e44b2fa0d7b73a0f97ca461) in the PR (https://github.com/Rdatatable/data.table/pull/4501/commits) that fixes the issue
340
347
Slower="cacdc92df71b777369a217b6c902c687cf35a70d", # Circa 2020 parent of the first commit (https://github.com/Rdatatable/data.table/commit/74636333d7da965a11dad04c322c752a409db098) in the PR (https://github.com/Rdatatable/data.table/pull/4501/commits) that fixes the issue
Slow="fd24a3105953f7785ea7414678ed8e04524e6955", # Parent of the merge commit (https://github.com/Rdatatable/data.table/commit/ed72e398df76a0fcfd134a4ad92356690e4210ea) of the PR (https://github.com/Rdatatable/data.table/pull/5054) that fixes the issue
377
384
Fast="ed72e398df76a0fcfd134a4ad92356690e4210ea", # Merge commit of the PR (https://github.com/Rdatatable/data.table/pull/5054) that fixes the issue
Copy file name to clipboardExpand all lines: NEWS.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@
12
12
13
13
3. options `"datatable.old.matrix.autoname"` is now `FALSE` by default, meaning `names(data.table(x=1, cbind(1)))` is now `c("x", "V2")`. Toggle the option to retain the old behavior for now; future releases will work to remove this possibility. See the release notes for 1.18.0, item 1 under `NOTE OF INTENDED FUTURE POTENTIAL BREAKING CHANGES`.
14
14
15
+
4.`is.numeric()` now returns `FALSE` for `IDate` and `ITime`, since these classes don't support arbitrary numeric operations, [#7746](https://github.com/Rdatatable/data.table/issues/7746). Thanks @aitap for the report and fix.
16
+
15
17
### NEW FEATURES
16
18
17
19
1.`nafill()`, `setnafill()` extended to work on logical, factor and character vectors (part of [#3992](https://github.com/Rdatatable/data.table/issues/3992)). Includes support for `Date`, `IDate`, `POSIXct` and character vectors. Thanks @jangorecki for the request and @jangorecki, @MichaelChirico and @ben-schwen for the PRs.
@@ -64,6 +66,10 @@
64
66
65
67
13.`rbindlist()` (and therefore the `rbind()` method for `data.table`s) no longer raises an error upon encountering more than approximately 50000 columns in a list entry, [#7793](https://github.com/Rdatatable/data.table/issues/7793). The bug was introduced in `data.table` version 1.18.2.1. Thanks to @rickhelmus for the report and @aitap for the fix.
66
68
69
+
14. Subtracting an `IDate` from a `Date` is fast again by avoiding unnecessary conversion to `POSIXlt`/`POSIXct`, [#7825](https://github.com/Rdatatable/data.table/issues/7825). Thanks @gilesheywood for the report and @ben-schwen for the fix.
70
+
71
+
15.`as.IDate()` and `as.ITime()` now preserve names, matching base `as.Date()` behavior, [#7252](https://github.com/Rdatatable/data.table/issues/7252). Thanks @DavisVaughan for the report and @venom1204 for the PR.
(setattr(as.integer(as.numeric(x) %/%86400L), "class", c("IDate", "Date"))) # %/% returns new object so can use setattr() on it; wrap with () to return visibly
42
-
else
47
+
if (is_utc(tz)) {
48
+
ans= as.integer(as.numeric(x) %/%86400L) # %/% returns a new object, so setattr() is safe
# 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."
(setattr(with(x, secs+min*60L+hour*3600L), "class", "ITime")) # () wrap to return visibly
224
+
ans= with(x, secs+min*60L+hour*3600L)
225
+
setattr(ans, "class", "ITime")
226
+
copy_names(ans, nm)
190
227
}
191
228
192
229
as.ITime.times=function(x, ms='truncate', ...) {
230
+
nm= names(x)
193
231
secs=86400L* (unclass(x) %%1L)
194
232
secs= clip_msec(secs, ms)
195
-
(setattr(secs, "class", "ITime")) # the first line that creates sec will create a local copy so we can use setattr() to avoid potential copy of class()<-
233
+
setattr(secs, "class", "ITime") # the first line that creates sec will create a local copy so we can use setattr() to avoid potential copy of class()<-
if (!(sum(!is_named) ==1L&&!is_named[n] && is.function(type.convert[[n]])))
57
57
stopf("When the argument 'type.convert' contains an unnamed element, it is expected to be the last element and should be a function. More than one unnamed element is not allowed unless all elements are functions with length equal to %d (the length of the transpose list or 'keep' argument if it is specified).", length(keep))
0 commit comments