Skip to content

Commit 72149e4

Browse files
authored
Merge branch 'master' into pythonRemoval
2 parents 7dbf720 + 8039a23 commit 72149e4

22 files changed

+227
-118
lines changed

.dev/CRAN_Release.cmd

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -584,26 +584,29 @@ bunzip2 inst/tests/*.Rraw.bz2 # decompress *.Rraw again so as not to commit com
584584
# Many thanks!
585585
# Best, Tyson
586586
# ------------------------------------------------------------
587-
# DO NOT commit or push to GitHub. Leave 4 files (.dev/CRAN_Release.cmd, DESCRIPTION, NEWS and init.c) edited and not committed. Include these in a single and final bump commit below.
588-
# DO NOT even use a PR. Because PRs build binaries and we don't want any binary versions of even release numbers available from anywhere other than CRAN.
587+
589588
# Leave milestone open with a 'release checks' issue open. Keep updating status there.
590589
# ** If on EC2, shutdown instance. Otherwise get charged for potentially many days/weeks idle time with no alerts **
591590
# If it's evening, SLEEP.
592591
# It can take a few days for CRAN's checks to run. If any issues arise, backport locally. Resubmit the same even version to CRAN.
593592
# CRAN's first check is automatic and usually received within an hour. WAIT FOR THAT EMAIL.
594593
# When CRAN's email contains "Pretest results OK pending a manual inspection" (or similar), or if not and it is known why not and ok, then bump dev.
595594

596-
###### Bump dev for NON-PATCH RELEASE
597-
# 0. Close milestone to prevent new issues being tagged with it. The final 'release checks' issue can be left open in a closed milestone.
598-
# 1. Check that 'git status' shows 4 files in modified and uncommitted state: DESCRIPTION, NEWS.md, init.c and this .dev/CRAN_Release.cmd
599-
# 2. 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.
600-
# 3. Add new heading in NEWS for the next dev version. Add "(submitted to CRAN on <today>)" on the released heading.
601-
# 4. Bump minor version in dllVersion() in init.c
602-
# 5. Bump 3 minor version numbers in Makefile
603-
# 6. 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-
# 7. Another final gd to view all diffs using meld. (I have `alias gd='git difftool &> /dev/null'` and difftool meld: http://meldmerge.org/)
605-
# 8. Push to master with this consistent commit message: "1.17.0 on CRAN. Bump to 1.17.99"
606-
# 9. Take sha from the previous step and run `git tag 1.17.0 96c..sha..d77` then `git push origin 1.16.0` (not `git push --tags` according to https://stackoverflow.com/a/5195913/403310)
595+
###### After submission for NON-PATCH RELEASE
596+
# 0. Start a new branch `cran-x.y.0` with the code as submitted to CRAN
597+
# - Check that 'git status' shows 4 files in modified and uncommitted state: DESCRIPTION, NEWS.md, init.c and this .dev/CRAN_Release.cmd
598+
# - 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
600+
# - 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.
601+
# - Add new heading in NEWS for the next dev version. Add "(submitted to CRAN on <today>)" on the released heading.
602+
# - Bump minor version in dllVersion() in init.c
603+
# - 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
605+
# - Another final gd to view all diffs using meld. (I have `alias gd='git difftool &> /dev/null'` and difftool meld: http://meldmerge.org/)
606+
# 2. Ideally, no PRs are reviewed while a CRAN submission is pending. Any reviews that do happen MUST target this branch, NOT master!
607+
# 3. Once the submission lands on CRAN, merge this branch WITHOUT SQUASHING!
608+
# 4. Close milestone to prevent new issues being tagged with it. The final 'release checks' issue can be left open in a closed milestone.
609+
# 5. Take SHA from the "...on CRAN. Bump to ..." commit and run `git tag 1.17.0 96c..sha..d77` then `git push origin 1.17.0` (not `git push --tags` according to https://stackoverflow.com/a/5195913/403310)
607610
######
608611

609612
###### Branching policy for PATCH RELEASE

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
3737
RSPM: ${{ matrix.config.rspm }}
3838
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
39+
_R_CHECK_RD_CHECKRD_MINLEVEL_: -Inf
3940

4041
steps:
4142
- uses: actions/checkout@v4

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ test-lin-rel:
114114
variables:
115115
_R_CHECK_FORCE_SUGGESTS_: "TRUE"
116116
OPENBLAS_MAIN_FREE: "1"
117+
_R_CHECK_RD_CHECKRD_MINLEVEL_: "-Inf"
117118
script:
118119
- *install-deps
119120
- echo 'CFLAGS=-g -O3 -flto=auto -fno-common -fopenmp -Wall -Wvla -pedantic -fstack-protector-strong -D_FORTIFY_SOURCE=2' > ~/.R/Makevars

GOVERNANCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Please also make a note in the change log under [`# Governance history`](#govern
108108

109109
# Finances and Funding
110110

111-
data.table is a [NumFOCUS](https://numfocus.org/) project. Donations to the data.table can be made at [https://numfocus.org/project/data-table]([https://numfocus.org/donate-to-data-table](https://app.hubspot.com/payments/FFWKWTTvKFdzqH?referrer=PAYMENT_LINK))
111+
data.table is a [NumFOCUS](https://numfocus.org/) project. Donations to data.table can be made at [https://numfocus.org/project/data-table](https://app.hubspot.com/payments/FFWKWTTvKFdzqH?referrer=PAYMENT_LINK).
112112

113113
*NumFOCUS is a 501(c)(3) non-profit charity in the United States; as such, donations to NumFOCUS are tax-deductible as allowed by law. As with any donation, you should consult with your personal tax adviser or the IRS about your particular tax situation.*
114114

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ if (getRversion() >= "3.6.0") {
155155
export(as.IDate,as.ITime,IDateTime)
156156
export(second,minute,hour,yday,wday,mday,week,isoweek,isoyear,month,quarter,year,yearmon,yearqtr)
157157

158+
if (getRversion() >= "4.3.0") S3method(chooseOpsMethod, IDate)
158159
S3method("[", ITime)
159160
S3method("+", IDate)
160161
S3method("-", IDate)

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@
101101
102102
15. `split.data.table()` output list elements retain the S3 class of the generating data.table, e.g. in `l=split(x, ...)` if `x` has class `my_class`, so will `l[[1]]` and so on, [#7105](https://github.com/Rdatatable/data.table/issues/7105). Thanks @m-muecke for the bug report and @MichaelChirico for the fix.
103103
104+
16. `between()` is now more robust with `integer64` arguments. Combining small integer `x` with certain large `integer64` bounds no longer misinterprets the bounds as `double`; if a `double` bound cannot be losslessly converted into `integer64` for comparison with `integer64` `x`, an error is signalled instead of returning a wrong answer with a warning; [#7164](https://github.com/Rdatatable/data.table/issues/7164). Thanks @aitap for the bug report and the fix.
105+
106+
17. `t1 - t2`, where one is an `IDate` and the other is a `Date`, are now consistent with the case where both are `IDate` or both are `Date`, [#4749](https://github.com/Rdatatable/data.table/issues/4749). Thanks @George9000 for the report and @MichaelChirico for the fix.
107+
108+
18. `fwrite` now allows `dec` to be the same as `sep` for edge cases where only one will be written, e.g. 0-row or 1-column tables. [#7227](https://github.com/Rdatatable/data.table/issues/7227). Thanks @MichaelChirico for the report and @venom1204 for the fix.
109+
104110
### NOTES
105111
106112
1. The following in-progress deprecations have proceeded:

R/IDateTime.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ round.IDate = function(x, digits=c("weeks", "months", "quarters", "years"), ...)
9191
years = ISOdate(year(x), 1L, 1L)))
9292
}
9393

94+
chooseOpsMethod.IDate = function(x, y, mx, my, cl, reverse) inherits(y, "Date")
95+
9496
#Adapted from `+.Date`
9597
`+.IDate` = function(e1, e2) {
9698
if (nargs() == 1L)
@@ -115,7 +117,7 @@ round.IDate = function(x, digits=c("weeks", "months", "quarters", "years"), ...)
115117
if (storage.mode(e1) != "integer")
116118
internal_error("storage mode of IDate is somehow no longer integer") # nocov
117119
if (nargs() == 1L)
118-
stopf("unary - is not defined for \"IDate\" objects")
120+
stopf('unary - is not defined for "IDate" objects')
119121
if (inherits(e2, "difftime"))
120122
internal_error("difftime objects may not be subtracted from IDate, but Ops dispatch should have intervened to prevent this") # nocov
121123

@@ -127,7 +129,12 @@ round.IDate = function(x, digits=c("weeks", "months", "quarters", "years"), ...)
127129
# ii) .Date was newly exposed in R some time after 3.4.4
128130
}
129131
ans = as.integer(unclass(e1) - unclass(e2))
130-
if (!inherits(e2, "Date")) setattr(ans, "class", c("IDate", "Date"))
132+
if (inherits(e2, "Date")) {
133+
setattr(ans, "class", "difftime")
134+
setattr(ans, "units", "days")
135+
} else {
136+
setattr(ans, "class", c("IDate", "Date"))
137+
}
131138
ans
132139
}
133140

R/fwrite.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fwrite = function(x, file="", append=FALSE, quote="auto",
4444
is.character(sep) && length(sep)==1L && (nchar(sep) == 1L || identical(sep, "")),
4545
is.character(sep2) && length(sep2)==3L && nchar(sep2[2L])==1L,
4646
is.character(dec) && length(dec)==1L && nchar(dec) == 1L,
47-
dec != sep, # sep2!=dec and sep2!=sep checked at C level when we know if list columns are present
47+
`dec and sep must be distinct whenever both might be needed` = (!NROW(x) || NCOL(x) <= 1L || dec != sep), # sep2!=dec and sep2!=sep checked at C level when we know if list columns are present
4848
is.character(eol) && length(eol)==1L,
4949
length(qmethod) == 1L && qmethod %chin% c("double", "escape"),
5050
length(compress) == 1L && compress %chin% c("auto", "none", "gzip"),

R/setops.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ all.equal.data.table = function(target, current, trim.levels=TRUE, check.attribu
160160
return(sprintf(
161161
"%s. 'target': %s. 'current': %s.",
162162
gettext("Datasets have different keys"),
163-
if(length(k1)) brackify(k1) else gettextf("has no key"),
164-
if(length(k2)) brackify(k2) else gettextf("has no key")
163+
if(length(k1)) brackify(k1) else gettext("has no key"),
164+
if(length(k2)) brackify(k2) else gettext("has no key")
165165
))
166166
}
167167
# check index
@@ -171,8 +171,8 @@ all.equal.data.table = function(target, current, trim.levels=TRUE, check.attribu
171171
return(sprintf(
172172
"%s. 'target': %s. 'current': %s.",
173173
gettext("Datasets have different indices"),
174-
if(length(i1)) brackify(i1) else gettextf("has no index"),
175-
if(length(i2)) brackify(i2) else gettextf("has no index")
174+
if(length(i1)) brackify(i1) else gettext("has no index"),
175+
if(length(i2)) brackify(i2) else gettext("has no index")
176176
))
177177
}
178178

R/test.data.table.R

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,30 @@ test.data.table = function(script="tests.Rraw", verbose=FALSE, pkg=".", silent=F
205205
}
206206
# nocov end
207207

208-
err = try(sys.source(fn, envir=env), silent=silent)
208+
env$warnings = list()
209+
err = try(
210+
withCallingHandlers(
211+
sys.source(fn, envir=env),
212+
warning=function(w) {
213+
# nocov start
214+
if (!silent && showProgress) print(w)
215+
env$warnings = c(env$warnings, list(list(
216+
"after test"=env$prevtest, warning=conditionMessage(w),
217+
calls=paste(
218+
vapply_1c(sys.calls(), function(call) {
219+
if (is.name(call[[1]])) {
220+
as.character(call[[1]])
221+
} else "..."
222+
}),
223+
collapse=" -> "
224+
)
225+
)))
226+
invokeRestart("muffleWarning")
227+
# nocov end
228+
}
229+
),
230+
silent=silent
231+
)
209232

210233
options(oldOptions)
211234
for (i in oldEnv) {
@@ -262,6 +285,21 @@ test.data.table = function(script="tests.Rraw", verbose=FALSE, pkg=".", silent=F
262285
# important to stopf() here, so that 'R CMD check' fails
263286
# nocov end
264287
}
288+
if (length(env$warnings)) {
289+
# nocov start
290+
warnings = rbindlist(env$warnings)
291+
catf(
292+
ngettext(nrow(warnings),
293+
"Caught %d warning outside the test() calls:\n",
294+
"Caught %d warnings outside the test() calls:\n"
295+
),
296+
nrow(warnings),
297+
domain=NA
298+
)
299+
print(warnings, nrows = nrow(warnings))
300+
stopf("Tests succeeded, but non-test code caused warnings. Search %s for tests shown above.", names(fn))
301+
# nocov end
302+
}
265303

266304
# There aren't any errors, so we can use up 11 lines for the timings table
267305
time = nTest = RSS = NULL # to avoid 'no visible binding' note

0 commit comments

Comments
 (0)