From 46df58f999f7ca94cdbcf1b2ad75b6fc59bfa1f6 Mon Sep 17 00:00:00 2001 From: wkmor1 Date: Wed, 19 Jul 2023 10:04:10 +0300 Subject: [PATCH] Remove soft dependency on blob package --- DESCRIPTION | 1 - R/api_get.R | 8 ++++++-- codemeta.json | 14 +------------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index aebe952f..4a72e1f7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -39,7 +39,6 @@ Imports: Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.3 Suggests: - blob, data.table, DBI, future, diff --git a/R/api_get.R b/R/api_get.R index da580381..62c5ffe6 100644 --- a/R/api_get.R +++ b/R/api_get.R @@ -75,11 +75,13 @@ api_get <- function(obj) { if (!DBI::dbExistsTable(fcp, "finbif_cache")) { + blob <- list() + init <- data.frame( hash = character(), created = as.POSIXct(numeric()), timeout = numeric(), - blob = blob::blob() + blob = structure(blob, class = "vctrs_vctr") ) DBI::dbWriteTable(fcp, "finbif_cache", init) @@ -410,13 +412,15 @@ append_obj <- function(obj) { blob <- serialize(obj, NULL) + blob <- list(blob) + hash <- obj[["hash"]] db_cache <- data.frame( hash = hash, created = Sys.time(), timeout = obj[["timeout"]], - blob = blob::blob(blob) + blob = structure(blob, class = "vctrs_vctr") ) debug_msg("[", as.character(Sys.time()), "] ", "Adding to cache: ", hash) diff --git a/codemeta.json b/codemeta.json index a7aa7ed5..4faa5d00 100644 --- a/codemeta.json +++ b/codemeta.json @@ -46,18 +46,6 @@ } ], "softwareSuggestions": [ - { - "@type": "SoftwareApplication", - "identifier": "blob", - "name": "blob", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=blob" - }, { "@type": "SoftwareApplication", "identifier": "data.table", @@ -257,7 +245,7 @@ "applicationCategory": "Biodiversity", "isPartOf": "https://species.fi", "keywords": ["api", "biodiversity", "biodiversity-informatics", "biodiversity-information", "finbif", "finbif-access", "occurrences", "r-package", "r-programming", "rstats", "species", "specimens", "taxon", "taxonomy", "web-services"], - "fileSize": "5374.771KB", + "fileSize": "5374.86KB", "citation": [ { "@type": "SoftwareSourceCode",