Skip to content

5 packages fail checks after prohibiting duplicate key columns #7770

Description

@tdhock

https://rcdata.nau.edu/genomic-ml/data.table-revdeps/analyze/2026-05-29/ says #7760 broke 5 package tests/examples/vignettes.

hi @ben-schwen by the looks of it, there should be changes in these revdeps (not data.table), can you please check?

Affected packages

Failing check output

bridger2

-* checking examples ... OK
+* checking examples ... ERROR
+Running examples in 'bridger2-Ex.R' failed
+The error most likely occurred in:
+
+> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
+> ### Name: BridgeRCore
+> ### Title: BridgeR basic function for calculating RNA half-life from
+> ###   BRIC-seq data
+> ### Aliases: BridgeRCore
+> 
+> ### ** Examples
+> 
+> halflife_table <- BridgeRCore(RNA_halflife_comparison[1:30,],
++                               save = FALSE)
+> halflife_table <- BridgeRCore(RNA_halflife_comparison_HK[177:206],
++                               save = FALSE,
++                               normalization = "house_keeping_genes",
++                               method = "3models")
+Error in setkeyv(inputFile, inforHKGenesRow) : 
+  x has duplicated column names in the columns to key by: [symbol]
+Calls: BridgeRCore ... BridgeRNormalizationFactorsHK -> setkeyv -> stopf -> raise_condition -> signal
+Execution halted
 * checking for unstated dependencies in 'tests' ... OK
-* checking tests ... OK
+* checking tests ... ERROR
   Running 'testthat.R'
+Running the tests in 'tests/testthat.R' failed.
+Complete output:
+  > library(testthat)
+  > library(bridger2)
+  > 
+  > test_check("bridger2")
+  Saving _problems/test-RNA_halflife_comparison-53.R
+  Saving _problems/test-RNA_halflife_core-15.R
+  [ FAIL 2 | WARN 2 | SKIP 0 | PASS 17 ]
+  
+  == Failed tests ================================================================
+  -- Error ('test-RNA_halflife_comparison.R:53:3'): Comparing RNA halflife -------
+  Error in `setkeyv(inputFile, searchRowName)`: x has duplicated column names in the columns to key by: [symbol]
+  Backtrace:
+      x
+   1. \-bridger2::BridgeReport(pvalue_table) at test-RNA_halflife_comparison.R:53:3
+   2.   \-data.table::setkeyv(inputFile, searchRowName)
+   3.     \-data.table:::stopf(...)
+   4.       \-data.table:::raise_condition(...)
+  -- Error ('test-RNA_halflife_core.R:12:3'): testing BridgeRCore 2 --------------
+  Error in `setkeyv(inputFile, inforHKGenesRow)`: x has duplicated column names in the columns to key by: [symbol]
+  Backtrace:
+      x
+   1. \-bridger2::BridgeRCore(...) at test-RNA_halflife_core.R:12:3
+   2.   \-bridger2::BridgeRNormalizationFactorsHK(...)
+   3.     \-data.table::setkeyv(inputFile, inforHKGenesRow)
+   4.       \-data.table:::stopf(...)
+   5.         \-data.table:::raise_condition(...)
+  
+  [ FAIL 2 | WARN 2 | SKIP 0 | PASS 17 ]
+  Error:
+  ! Test failures.
+  Execution halted
 * checking PDF version of manual ... OK
 * DONE
-Status: OK
+Status: 2 ERRORs

dbi.table

-* checking tests ... OK
+* checking tests ... ERROR
   Running 'testthat.R'
+Running the tests in 'tests/testthat.R' failed.
+Complete output:
+  > # This file is part of the standard setup for testthat.
+  > # It is recommended that you do not modify it.
+  > #
+  > # Where should you do additional test configuration?
+  > # Learn more about the roles of various files in:
+  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
+  > # * https://testthat.r-lib.org/articles/special-files.html
+  > 
+  > library(testthat)
+  > library(dbi.table)
+  > 
+  > test_check("dbi.table")
+  
+  Attaching package: 'data.table'
+  
+  The following object is masked from 'package:base':
+  
+      %notin%
+  
+  Saving _problems/test-merge-71.R
+  Saving _problems/test-merge-71.R
+  [ FAIL 2 | WARN 0 | SKIP 2 | PASS 420 ]
+  
+  == Skipped tests (2) ===========================================================
+  * On CRAN (2): 'test-mariadb.R:10:3', 'test-postgres.R:11:3'
+  
+  == Failed tests ================================================================
+  -- Error ('test-merge.R:69:5'): self merge works with no.dups = FALSE [chinook_sqlite] --
+  Error in `setkeyv(x, key)`: x has duplicated column names in the columns to key by: [AlbumId]
+  Backtrace:
+       x
+    1. +-testthat::expect_warning(...) at test-merge.R:69:5
+    2. | \-testthat:::expect_condition_matching_(...)
+    3. |   \-testthat:::quasi_capture(...)
+    4. |     +-testthat (local) .capture(...)
+    5. |     | \-base::withCallingHandlers(...)
+    6. |     \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
+    7. \-dbi.table::reference.test(...)
+    8.   +-data.table::as.data.table(dbit_eval)
+    9.   \-dbi.table (local) as.data.table.dbi.table(dbit_eval)
+   10.     \-data.table::setDT(x, key = x_key)
+   11.       \-data.table::setkeyv(x, key)
+   12.         \-data.table:::stopf(...)
+   13.           \-data.table:::raise_condition(...)
+  -- Error ('test-merge.R:69:5'): self merge works with no.dups = FALSE [chinook_duckdb] --
+  Error in `setkeyv(x, key)`: x has duplicated column names in the columns to key by: [AlbumId]
+  Backtrace:
+       x
+    1. +-testthat::expect_warning(...) at test-merge.R:69:5
+    2. | \-testthat:::expect_condition_matching_(...)
+    3. |   \-testthat:::quasi_capture(...)
+    4. |     +-testthat (local) .capture(...)
+    5. |     | \-base::withCallingHandlers(...)
+    6. |     \-rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
+    7. \-dbi.table::reference.test(...)
+    8.   +-data.table::as.data.table(dbit_eval)
+    9.   \-dbi.table (local) as.data.table.dbi.table(dbit_eval)
+   10.     \-data.table::setDT(x, key = x_key)
+   11.       \-data.table::setkeyv(x, key)
+   12.         \-data.table:::stopf(...)
+   13.           \-data.table:::raise_condition(...)
+  
+  [ FAIL 2 | WARN 0 | SKIP 2 | PASS 420 ]
+  Error:
+  ! Test failures.
+  Execution halted
 * checking for unstated dependencies in vignettes ... OK
 * checking package vignettes ... OK
 * checking re-building of vignette outputs ... OK
 * checking PDF version of manual ... OK
 * DONE
-Status: OK
+Status: 1 ERROR

formulaic

-* checking examples ... OK
+* checking examples ... ERROR
+Running examples in 'formulaic-Ex.R' failed
+The error most likely occurred in:
+
+> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
+> ### Name: reduce.existing.formula
+> ### Title: Reduce Existing Formula
+> ### Aliases: reduce.existing.formula
+> 
+> ### ** Examples
+> 
+> data('snack.dat')
+> the.initial.formula <- 'Income ~ .'
+> 
+> reduce.existing.formula(the.initial.formula = the.initial.formula,dat = snack.dat,
++   max.input.categories = 30)$formula
+Error in setnames(x = num.unique.tab, old = "V1", new = outcome.name) : 
+  The new names would result in duplicated key columns: [Income]
+Calls: reduce.existing.formula ... create.formula -> setnames -> stopf -> raise_condition -> signal
+Execution halted
 * checking for unstated dependencies in 'tests' ... OK
-* checking tests ... OK
+* checking tests ... ERROR
   Running 'testthat.R'
+Running the tests in 'tests/testthat.R' failed.
+Complete output:
+  > testthat::test_check("formulaic")
+  Loading required package: formulaic
+  Saving _problems/test-reduce-formula-10.R
+  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 8 ]
+  
+  == Failed tests ================================================================
+  -- Error ('test-reduce-formula.R:6:1'): (code run outside of `test_that()`) ----
+  Error in `setnames(x = num.unique.tab, old = "V1", new = outcome.name)`: The new names would result in duplicated key columns: [Awareness]
+  Backtrace:
+      x
+   1. \-formulaic::reduce.existing.formula(...) at test-reduce-formula.R:6:1
+   2.   \-formulaic::create.formula(...)
+   3.     \-data.table::setnames(x = num.unique.tab, old = "V1", new = outcome.name)
+   4.       \-data.table:::stopf(...)
+   5.         \-data.table:::raise_condition(...)
+  
+  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 8 ]
+  Error:
+  ! Test failures.
+  Execution halted
 * checking for unstated dependencies in vignettes ... OK
 * checking package vignettes ... OK
-* checking re-building of vignette outputs ... OK
+* checking re-building of vignette outputs ... ERROR
+Error(s) in re-building vignettes:
+--- re-building 'Introduction-to-formulaic.Rmd' using rmarkdown
+
+Quitting from Introduction-to-formulaic.Rmd:557-566 [create.formula large volume of categorical variables]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+<error/rlang_error>
+Error in `setnames()`:
+! The new names would result in duplicated key columns: [Income]
+---
+Backtrace:
+    x
+ 1. \-formulaic::create.formula(...)
+ 2.   \-data.table::setnames(x = num.unique.tab, old = "V1", new = outcome.name)
+ 3.     \-data.table:::stopf(...)
+ 4.       \-data.table:::raise_condition(...)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Error: processing vignette 'Introduction-to-formulaic.Rmd' failed with diagnostics:
+The new names would result in duplicated key columns: [Income]
+--- failed re-building 'Introduction-to-formulaic.Rmd'
+
+SUMMARY: processing the following file failed:
+  'Introduction-to-formulaic.Rmd'
+
+Error: Vignette re-building failed.
+Execution halted
+
 * checking PDF version of manual ... OK
 * DONE
-Status: OK
+Status: 3 ERRORs

multifamm

-* checking examples ... OK
-Examples with CPU (user + system) or elapsed time > 5s
-           user system elapsed
-multiFAMM 9.478  0.291  10.097
+* checking examples ... ERROR
+Running examples in 'multifamm-Ex.R' failed
+The error most likely occurred in:
+
+> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
+> ### Name: multiFAMM
+> ### Title: Multivariate Functional Additive Mixed Model Regression
+> ### Aliases: multiFAMM
+> 
+> ### ** Examples
+> 
+> 
+> # subset of the phonetic data (very small subset, no meaningful results can
+> # be expected and no random effects other than the random smooth should be
+> # included in the model)
+> 
+> data(phonetic_subset)
+> 
+> m <- multiFAMM(data = phonetic_subset, covariate = TRUE, num_covariates = 2,
++                covariate_form = c("by", "by"), interaction = TRUE,
++                which_interaction = matrix(c(FALSE, TRUE, TRUE, FALSE),
++                nrow = 2, ncol = 2), bf_covs = c(5), m_covs = list(c(2, 3)),
++                mfpc_cut_method = "total_var", final_method = "w_bam")
+--------------------------------------
+sparseFLMM for Dimension aco 
+--------------------------------------
+Warning in sparseFLMM::sparseFLMM(curve_info = data, use_RI = use_RI, use_simple = use_simple,  :
+  as use_famm == FALSE, no confidence bands for mean and covariate effects are given out
+mean estimation; time: Fri May 29 03:11:57
+get cross products; time: Fri May 29 03:11:57
+Error in setnames(crosstable, old = c("id", "y_tilde", "t", "subj1", "subj2"),  : 
+  The new names would result in duplicated key columns: [id2]
+Calls: multiFAMM ... make_crossprod_dt -> setnames -> stopf -> raise_condition -> signal
+Execution halted
 * checking PDF version of manual ... OK
 * DONE
-Status: OK
+Status: 1 ERROR

popEpi

-* checking tests ... OK
+* checking tests ... ERROR
   Running 'testthat.R'
+Running the tests in 'tests/testthat.R' failed.
+Complete output:
+  > 
+  > if (requireNamespace("testthat")) {
+  +   library("testthat")
+  +   library("popEpi")
+  +   library("data.table")
+  + 
+  +   using_r_devel <- grepl(pattern = "devel", x = R.version$status)
+  +   if (using_r_devel) {
+  +     ## memory leak problem in data.table 1.11.2 in R-devel (3.6.0 atm)
+  +     requireNamespace("data.table")
+  +     data.table::setDTthreads(threads = 1L)
+  +   }
+  + 
+  +   testthat::test_check("popEpi")
+  + }
+  Loading required namespace: testthat
+  
+  Attaching package: 'data.table'
+  
+  The following object is masked from 'package:base':
+  
+      %notin%
+  
+  Saving _problems/test_aggre-71.R
+  NOTE: entry.status has been set to "DM" for all.
+     first.bad.surv.int last.bad.surv.int surv.obs
+                  <int>             <int>    <num>
+  1:                 61               120      NaN
+     first.bad.surv.int last.bad.surv.int surv.obs
+                  <int>             <int>    <num>
+  1:                 61               120      NaN
+  Key: <agegr>
+     agegr first.bad.surv.int last.bad.surv.int surv.obs
+     <int>              <int>             <int>    <num>
+  1:     3                 61               120      NaN
+  Key: <agegr>
+     agegr first.bad.surv.int last.bad.surv.int surv.obs
+     <int>              <int>             <int>    <num>
+  1:     3                 61               120      NaN
+  [ FAIL 1 | WARN 0 | SKIP 41 | PASS 258 ]
+  
+  == Skipped tests (41) ==========================================================
+  * Unit tests skipped normally (41): 'test_aggre.R:162:3', 'test_aggre.R:199:3',
+    'test_expo.R:4:3', 'test_lexpand.R:5:3', 'test_lexpand.R:29:3',
+    'test_lexpand.R:59:3', 'test_lexpand.R:78:3', 'test_lexpand.R:99:3',
+    'test_lexpand.R:137:3', 'test_lexpand.R:213:3', 'test_lexpand.R:249:3',
+    'test_lexpand.R:342:3', 'test_relpois_mean_curve.R:4:3', 'test_sir.R:221:5',
+    'test_sir.R:257:3', 'test_splitLexisDT.R:4:3', 'test_splitMulti.R:9:3',
+    'test_splitting_breaks.R:5:3', 'test_splitting_breaks.R:39:3',
+    'test_splitting_randomly_on_fixed_data.R:9:3',
+    'test_splitting_randomly_on_random_data.R:9:3', 'test_survmean.R:6:3',
+    'test_survmean.R:76:3', 'test_survmean.R:117:3', 'test_survmean.R:166:3',
+    'test_survmean.R:265:3', 'test_survtab_adjusted.R:4:3',
+    'test_survtab_observed.R:67:3', 'test_survtab_relative.R:81:5',
+    'test_survtab_usage.R:6:3', 'test_survtab_usage.R:121:3',
+    'test_survtab_usage.R:198:3', 'test_survtab_usage.R:432:3',
+    'test_utils.R:4:3', 'test_utils.R:27:3', 'test_utils.R:138:3',
+    'test_utils.R:179:3', 'test_weighter.R:5:3', 'test_weighter.R:47:3',
+    'test_weighter.R:99:3', 'test_weighter.R:122:3'
+  
+  == Failed tests ================================================================
+  -- Error ('test_aggre.R:71:3'): aggre and lexpand produce the same results -----
+  Error in `setkeyv(x, v)`: cols contains duplicate column names: [sex]
+  Backtrace:
+      x
+   1. \-data.table::setkeyv(x, v) at test_aggre.R:71:3
+   2.   \-data.table:::stopf(...)
+   3.     \-data.table:::raise_condition(...)
+  
+  [ FAIL 1 | WARN 0 | SKIP 41 | PASS 258 ]
+  Error:
+  ! Test failures.
+  Execution halted
 * checking for unstated dependencies in vignettes ... OK
 * checking package vignettes ... OK
 * checking re-building of vignette outputs ... OK
 * checking PDF version of manual ... OK
 * DONE
-Status: OK
+Status: 1 ERROR

Activity

  1. ben-schwen commented on May 31, 2026

    @ben-schwen
    Member

    I have filed a PR for popEpi

  2. ben-schwen commented on May 31, 2026

    @ben-schwen
    Member
  3. MichaelChirico commented on May 31, 2026

    @MichaelChirico
    Member
  4. ben-schwen commented on May 31, 2026

    @ben-schwen
    Member
  5. ben-schwen commented on May 31, 2026

    @ben-schwen
    Member

    shall we put this behind a deprecation cycle?

    Could but the previous behavior was a serious bug and one of the reasons I personally don't use keys

  6. ben-schwen commented on May 31, 2026

    @ben-schwen
    Member

    Filed BridgeR2

  7. tdhock commented on May 31, 2026

    @tdhock
    MemberAuthor

    you don’t use keys!!!!

  8. MichaelChirico commented on May 31, 2026

    @MichaelChirico
    Member

    let's have @Rdatatable/committers weigh in on if this is something to put in deprecation cycle.

    my own vote: this is a bugfix and doesn't need to be deprecated.

    opinion weakly held, can't say it's affected me.

  9. aitap commented on Jun 6, 2026

    @aitap
    Member

    The two packages that have recursive reverse dependencies (formulaic with one and popEpi with 16) have already merged their fixes. If the remaining three packages merge their fixes soon, it should be fine to go without a deprecation cycle. Otherwise I'd make it a loud warning ("proceeding with data.table unsorted by duplicated columns"), but it might still be fine to leave the error in.

    The multifamm problem is actually a bug in sparseFLMM: the failing call is setnames(crosstable, old = c("id", "y_tilde", "t", "subj1", "subj2"), new = c("id2", "y2", "t2", "row_subject_bivariate", "col_subject_bivariate")), where key(crosstable) is id and names(crosstable) are c("id1", "subj1", "n1", "id2", "subj2", "n2", "id", "y1", "t1", "y_tilde", "t"), i.e., id2 already exists. The id2 column has been created by the same function a few lines above. E-mail sent to the sparseFLMM maintainer...

  10. ben-schwen commented on Jun 9, 2026

    @ben-schwen
    Member

    Ty for the analysis and e-mail @aitap

    I see this also as a bug fix and therefore does not need a deprecation cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    revdepReverse dependencies

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions