Repository navigation
Closed
Description
131af20 is responsible for several new revdep issues:
https://rcdata.nau.edu/genomic-ml/data.table-revdeps/analyze/2025-07-08/
dtts tests (output too large to be useful here) search for "checking tests" in https://rcdata.nau.edu/genomic-ml/data.table-revdeps/analyze/2025-07-08/dtts.txt
tidytable
* checking tests ...
Running 'testthat.R'
ERROR
Running the tests in 'tests/testthat.R' failed.
Complete output:
> library(testthat)
> library(tidytable)
Attaching package: 'tidytable'
The following object is masked from 'package:testthat':
matches
The following objects are masked from 'package:stats':
dt, filter, lag
The following object is masked from 'package:base':
%in%
>
> test_check("tidytable")
[ FAIL 1 | WARN 2158 | SKIP 0 | PASS 1335 ]
== Failed tests ================================================================
-- Failure ('test-as_tidytable.R:23:3'): works ---------------------------------
Names of `.m` ('id', 'x') don't match 'id', 'V1'
[ FAIL 1 | WARN 2158 | SKIP 0 | PASS 1335 ]
Error: Test failures
Execution halted
vardpoor
* checking examples ... ERROR
Running examples in 'vardpoor-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: vardannual
> ### Title: Variance estimation for measures of annual net change or annual
> ### for single and multistage stage cluster sampling designs
> ### Aliases: vardannual
> ### Keywords: vardannual
>
> ### ** Examples
>
>
> ### Example
> library("data.table")
>
> set.seed(1)
>
> data("eusilc", package = "laeken")
> eusilc1 <- eusilc[1:20, ]
> rm(eusilc)
>
> dataset1 <- data.table(rbind(eusilc1, eusilc1),
+ year = c(rep(2010, nrow(eusilc1)),
+ rep(2011, nrow(eusilc1))))
> rm(eusilc1)
>
> dataset1[, country := "AT"]
> dataset1[, half := .I - 2 * trunc((.I - 1) / 2)]
> dataset1[, quarter := .I - 4 * trunc((.I - 1) / 4)]
> dataset1[age < 0, age := 0]
>
> PSU <- dataset1[, .N, keyby = "db030"][, N := NULL][]
> PSU[, PSU := trunc(runif(.N, 0, 5))]
>
> dataset1 <- merge(dataset1, PSU, all = TRUE, by = "db030")
> rm(PSU)
>
> dataset1[, strata := "XXXX"]
> dataset1[, employed := trunc(runif(.N, 0, 2))]
> dataset1[, unemployed := trunc(runif(.N, 0, 2))]
> dataset1[, labour_force := employed + unemployed]
> dataset1[, id_lv2 := paste0("V", .I)]
>
> vardannual(Y = "employed", H = "strata",
+ PSU = "PSU", w_final = "rb050",
+ ID_level1 = "db030", ID_level2 = "id_lv2",
+ Dom = NULL, Z = NULL, years = "year",
+ subperiods = "half", dataset = dataset1,
+ percentratio = 100, confidence = 0.95,
+ method = "cros")
Warning in melt.data.table(DTagg, id = c(namesperc, gnamesDom), measure = varsYZ, :
measure.vars is a list with length=1, which as long documented should return integer indices in the 'variable' column, but currently returns character column names. To increase consistency in the next release, we plan to change 'variable' to integer, so users who were relying on this behavior should change measure.vars=list('col_name') (output variable is column name now, but will become column index/integer) to measure.vars='col_name' (variable is column name before and after the planned change).
Warning in melt.data.table(DT2, id = namesperc, measure = varsYZ, variable.factor = FALSE) :
measure.vars is a list with length=1, which as long documented should return integer indices in the 'variable' column, but currently returns character column names. To increase consistency in the next release, we plan to change 'variable' to integer, so users who were relying on this behavior should change measure.vars=list('col_name') (output variable is column name now, but will become column index/integer) to measure.vars='col_name' (variable is column name before and after the planned change).
Error in setnames(annual_var, c("V1"), c("var")) :
Items of 'old' not found in column names: [V1]. Consider skip_absent=TRUE.
Calls: vardannual ... FUN -> setnames -> stopf -> raise_condition -> signal
Execution halted
Activity
tdhock commentedon Jul 8, 2025
@jangorecki @MichaelChirico can you please investigate?
MichaelChirico commentedon Jul 8, 2025
I just saw those, thanks for filing. We may need to put that change through a formal deprecation cycle.
tdhock commentedon Jul 8, 2025
this also affects library(latrend) https://rcdata.nau.edu/genomic-ml/data.table-revdeps/analyze/2025-07-07/latrend.txt
with the following two check diffs using R-devel:
interesting that these do not show up on the check machine using R-4.5.1 because there are errors for those checks with both versions of data.table
MichaelChirico commentedon Jul 8, 2025
It looks like we've introduced some undesirably inconsistent behavior:
That's because
as.data.tablewithkeep.rownamescan pick up thexname automatically here:data.table/R/as.data.table.R
Line 50 in 4cf9a70
I haven't thought through yet what's the "correct" behavior, but on
masterthey both produceV1columns, which is at least consistent.At a glance, producing
xmay seem strange -- the user didn't provide anything namedx, so where did this mysterious name come from? One fix is to just explicitly passV1 = ...there...MichaelChirico commentedon Jul 10, 2025
dtts, latrend, and vardpoor continue to fail after #7149.
MichaelChirico commentedon Jul 10, 2025
For {dtts}, here is the crux of the issue:
I think the new behavior is better, but I reckon this still warrants a deprecation cycle, WDYT @jangorecki?
MichaelChirico commentedon Jul 11, 2025
By way of more motivation for a breaking change:
jangorecki commentedon Jul 11, 2025
Just before the release it is not good to introduce breaking change so better keep it as coming, to test with an option, as you did in PR, and change from the next release.
tdhock commentedon Jul 30, 2025
I guess this was fixed by #7158 revdep machine says this is now OK
tdhock commentedon Aug 31, 2025
revdep machine says that vardpoor is again failing but with a different error:
versus before the error at the same line in those examples was:
tdhock commentedon Oct 21, 2025
vardpoor failure is related to a different PR, #7266 so closing.