Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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()`
Expand Down
4 changes: 3 additions & 1 deletion R/dp_write.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 22 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}