From c9b18a9de61a6e1ec85a5d759011f8fb2243b739 Mon Sep 17 00:00:00 2001 From: Eliot McIntire Date: Tue, 1 Sep 2026 10:41:42 -0700 Subject: [PATCH] fix: declare hms in Imports (required by RSQLite, not declared by it) The no-suggests CI leg fails with: * checking examples ... ERROR Error in check_suggested("hms", "dbConnect") : sqlite_connect_db() calls RSQLite::dbConnect(extended_types = TRUE), which makes RSQLite return DATETIME columns as hms/POSIXct and therefore requires the hms package at runtime. RSQLite declares hms in its Suggests, not Imports, so nothing in the dependency graph guarantees it is installed. That is invisible in a normal check -- Suggests are installed anyway -- but fails under _R_CHECK_DEPENDS_ONLY_=true, which builds a library containing only this package's Depends/Imports/LinkingTo. The requirement is real and RSQLite does not state it correctly, so climateData declares it. Rationale recorded next to the dbConnect call rather than in DESCRIPTION, which is DCF and cannot carry comments. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_012DVjmY3im9Xak7tXLSMGCa --- DESCRIPTION | 1 + R/ClimateNA_createTiles.R | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ec633e9..2eeb1d8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -24,6 +24,7 @@ Imports: fs, future.apply, glue, + hms, methods, parallel, parallelly, diff --git a/R/ClimateNA_createTiles.R b/R/ClimateNA_createTiles.R index a2d0ab0..076bd82 100644 --- a/R/ClimateNA_createTiles.R +++ b/R/ClimateNA_createTiles.R @@ -81,11 +81,22 @@ ClimateNA_path <- function(dataPath, tile = NULL, type = NULL, msy = NULL, gcm = sqlite_connect_db <- function(dbfile) { firstRun <- file.exists(dbfile) + ## `extended_types = TRUE` makes RSQLite return DATETIME columns as hms / + ## POSIXct, which requires the `hms` package AT RUNTIME. RSQLite declares hms + ## only in its Suggests, not Imports, so nothing in the dependency graph + ## guarantees it is installed -- `RSQLite::dbConnect(extended_types = TRUE)` + ## then fails with `check_suggested("hms", "dbConnect")`. + ## + ## That is invisible in a normal check, where Suggests are present anyway, but + ## fails under _R_CHECK_DEPENDS_ONLY_=true (the no-suggests CI leg), which + ## builds a library containing only this package's Depends/Imports/LinkingTo. + ## climateData therefore declares hms in its own Imports: the requirement is + ## real and RSQLite does not state it correctly. db <- RSQLite::dbConnect( drv = RSQLite::SQLite(), dbname = dbfile, synchronous = "normal", - extended_types = TRUE ## for DATETIME + extended_types = TRUE ## for DATETIME -- see note above re: hms ) if (isTRUE(firstRun)) {