diff --git a/DESCRIPTION b/DESCRIPTION index f5e276d..f1969f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dpbuild Title: A package to manage building of data products -Version: 0.3.0 +Version: 0.3.1 Authors@R: person(given = "Afshin", family = "Mashadi-Hossein", @@ -40,4 +40,4 @@ Config/testthat/edition: 3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 diff --git a/NEWS.md b/NEWS.md index 8c03e43..cd31f35 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# dpbuild 0.3.1 + +* Fixed the bug related to the daap pin version not being captured properly in the log file + # dpbuild 0.3.0 * Enable saving data objects in qs format via the "type" param in `dp_write()` diff --git a/R/dp_write.R b/R/dp_write.R index b94ca58..30f925c 100644 --- a/R/dp_write.R +++ b/R/dp_write.R @@ -21,9 +21,11 @@ dp_write <- function(data_object, type = 'rds', project_path = ".") { "a properly formatted dp" ))) } - + dataobj_path <- save_object(data_object, project_path = project_path, type = type) + data_object <- object_read( project_path = project_path, type = type) + log_note <- dplognote_get( data_object = data_object, dataobj_path = dataobj_path, diff --git a/R/utils.R b/R/utils.R index f970b66..a643678 100644 --- a/R/utils.R +++ b/R/utils.R @@ -323,3 +323,25 @@ check_pins_compatibility <- function(project_path = "."){ } } +#' @title Read data output object +#' @description read the output data object, for now only rds and qs are supported +#' @noRd +object_read <- function(project_path, type) { + type <- rlang::arg_match0(type, c("rds", "qs")) + switch(type, + rds = readRDS(file = glue::glue("{project_path}/output_files/RDS_format/data_object.RDS")), + qs = read_qs(project_path) + ) +} + +#' @title Reas qs object +#' @description Read in qs object +#' @noRd +read_qs <- function(path) { + rlang::check_installed("qs") + dataobj_path <- glue::glue( + "{path}/", + "output_files/qs_format/data_object.qs" + ) + qs::qread(dataobj_path) +} \ No newline at end of file