Bioconductor/BiocFileCache

BiocFileCache:::.sql_db_execute(): Partial argument match of 'param' to 'params'

Closed this issue · 1 comments

Issue

> options(warnPartialMatchArgs=TRUE, warn=2)
> eh <- ExperimentHub::ExperimentHub()
~/.cache/ExperimentHub
  does not exist, create directory? (yes/no): yes
Error in .local(conn, statement, ...) : 
  (converted from warning) partial argument match of 'param' to 'params'
> traceback()
18: doWithOneRestart(return(expr), restart)
17: withOneRestart(expr, restarts[[1L]])
16: withRestarts({
        .Internal(.signalCondition(simpleWarning(msg, call), msg, 
            call))
        .Internal(.dfltWarn(msg, call))
    }, muffleWarning = function() NULL)
15: .signalSimpleWarning("partial argument match of 'param' to 'params'", 
        base::quote(.local(conn, statement, ...)))
14: dbSendQuery(conn, statement, ...)
13: dbSendQuery(conn, statement, ...)
12: dbSendStatement(conn, statement, ...)
11: dbSendStatement(conn, statement, ...)
10: dbExecute(con, sql, param = param)
9: dbExecute(con, sql, param = param)
8: .sql_db_execute(bfc, sql[[2]], con = con)
7: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch({
       con <- .sql_connect_RW(.sql_dbfile(bfc))
       dbExecute(con, sql[[1]])
       .sql_db_execute(bfc, sql[[2]], con = con)
       package_version <- as.character(packageVersion("BiocFileCache"))
       .sql_db_execute(bfc, sql[[3]], key = c("schema_version", 
           "package_version"), value = c(.CURRENT_SCHEMA_VERSION, 
           package_version), con = con)
       .sql_db_execute(bfc, sql[[4]], con = con)
       dbExecute(con, sql[[5]])
   }, finally = {
       dbDisconnect(con)
   })
5: .sql_create_db(bfc)
4: BiocFileCache(cache = cache, ask = ask)
3: .create_cache(.class, url, cache, proxy, localHub, ask)
2: .Hub("ExperimentHub", hub, cache, proxy, localHub, ask, ...)
1: ExperimentHub::ExperimentHub()

Solution

In .sql_db_execute() function, pass params = param;

BiocFileCache/R/sql.R

Lines 106 to 119 in 0685885

.sql_db_execute <-
function(bfc, sql, ..., con)
{
param <- data.frame(..., stringsAsFactors = FALSE)
if (nrow(param) == 0L)
param <- NULL
if (missing(con)) {
info <- .sql_connect_RW(.sql_dbfile(bfc))
con <- info$con
on.exit(.sql_disconnect(info))
}
dbExecute(con, sql, param = param)
}

lshep commented

thank you for reporting. I'll look at updating soon.