Skip to content

Commit

Permalink
Fix #1158
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Oct 4, 2023
1 parent 1962c86 commit c9127ba
Show file tree
Hide file tree
Showing 59 changed files with 75 additions and 65 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Description: Pipeline tools coordinate the pieces of computationally
The methodology in this package
borrows from GNU 'Make' (2015, ISBN:978-9881443519)
and 'drake' (2018, <doi:10.21105/joss.00550>).
Version: 1.3.0.9002
Version: 1.3.0.9003
License: MIT + file LICENSE
URL: https://docs.ropensci.org/targets/, https://github.com/ropensci/targets
BugReports: https://github.com/ropensci/targets/issues
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# targets 1.3.0.9001 (development)
# targets 1.3.0.9003 (development)

* Add `tar_config_projects()` and `tar_config_yaml()` (#1153, @psychelzh).
* Apply error modes to `builder_wait_correct_hash()` in `target_conclude.tar_builder()` (#1154, @gadenbuie).
* Remove duplicated error message from `builder_error_null()`.
* Allow `tar_meta_upload()` and `tar_meta_download()` to avoid errors if one or more metadata files do not exist. Add a new argument `strict` to control error behavior.
* Add new arguments `meta`, `progress`, `process`, and `crew` to control individual metadata files in `tar_meta_upload()`, `tar_meta_download()`, `tar_meta_sync()`, and `tar_meta_delete()`.
* Avoid newly deprecated arguments and functions in `crew` 0.5.0.9003 (https://github.com/wlnadau/crew/issues/131).
* Allow `tar_read()` etc. inside a pipeline whenever it uses a different data store (#1158, @MilesMcBain).

# targets 1.3.0

Expand Down
2 changes: 1 addition & 1 deletion R/tar_built.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tar_built <- function(
names = NULL,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_built")
tar_assert_allow_meta("tar_built", store)
progress <- progress_init(path_store = store)
progress <- tibble::as_tibble(progress$database$read_condensed_data())
names_quosure <- rlang::enquo(names)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_canceled.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tar_canceled <- function(
names = NULL,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_canceled")
tar_assert_allow_meta("tar_canceled", store)
progress <- progress_init(path_store = store)
progress <- tibble::as_tibble(progress$database$read_condensed_data())
names_quosure <- rlang::enquo(names)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_config_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ tar_config_set <- function(
) {
# TODO: remove single-project format, which was deprecated on
# 2021-09-03 (version 0.7.0.9001).
tar_assert_allow_meta("tar_config_set")
tar_assert_allow_meta("tar_config_set", store)
tar_assert_chr(config)
tar_assert_scalar(config)
tar_assert_chr(project)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_config_unset.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tar_config_unset <- function(
config = Sys.getenv("TAR_CONFIG", "_targets.yaml"),
project = Sys.getenv("TAR_PROJECT", "main")
) {
tar_assert_allow_meta("tar_config_unset")
tar_assert_allow_meta("tar_config_unset", store)
tar_assert_chr(config)
tar_assert_scalar(config)
tar_assert_chr(project)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_crew.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#' })
#' }
tar_crew <- function(store = targets::tar_config_get("store")) {
tar_assert_allow_meta("tar_crew")
tar_assert_allow_meta("tar_crew", store)
tar_assert_scalar(store)
tar_assert_chr(store)
tar_assert_nzchar(store)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_deduplicate.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tar_deduplicate <- function(
progress = TRUE,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_deduplicate")
tar_assert_allow_meta("tar_deduplicate", store)
tar_warn_deprecate(
"tar_deduplicate() is deprecated in version 0.3.0 (2020-03-06). ",
"The tar_make*() functions do enough deduplication now automatically."
Expand Down
2 changes: 1 addition & 1 deletion R/tar_delete.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ tar_delete <- function(
cloud = TRUE,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_delete")
tar_assert_allow_meta("tar_delete", store)
tar_assert_store(store = store)
tar_assert_path(path_meta(store))
meta <- meta_init(path_store = store)$database$read_condensed_data()
Expand Down
2 changes: 1 addition & 1 deletion R/tar_destroy.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ tar_destroy <- function(
script = targets::tar_config_get("script"),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_destroy")
tar_assert_allow_meta("tar_destroy", store)
if (!file.exists(store)) {
return(invisible())
}
Expand Down
1 change: 0 additions & 1 deletion R/tar_edit.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
tar_edit <- function(script = targets::tar_config_get("script")) {
# Covered in tests/interactive/test-tar_edit.R # nolint
# nocov start
tar_assert_allow_meta("tar_edit")
tar_assert_package("usethis")
usethis::edit_file(path = script, open = TRUE)
# nocov end
Expand Down
2 changes: 1 addition & 1 deletion R/tar_errored.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tar_errored <- function(
names = NULL,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_errored")
tar_assert_allow_meta("tar_errored", store)
progress <- progress_init(path_store = store)
progress <- tibble::as_tibble(progress$database$read_condensed_data())
names_quosure <- rlang::enquo(names)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_exist_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
#' @examples
#' tar_exist_meta()
tar_exist_meta <- function(store = targets::tar_config_get("store")) {
tar_assert_allow_meta("tar_exist_meta")
tar_assert_allow_meta("tar_exist_meta", store)
file.exists(path_meta(path_store = store))
}
2 changes: 1 addition & 1 deletion R/tar_exist_objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tar_exist_objects <- function(
cloud = TRUE,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_exist_objects")
tar_assert_allow_meta("tar_exist_objects", store)
tar_assert_chr(names, "names must be a character vector.")
meta <- if_any(file.exists(store), tar_meta(store = store), data_frame())
out <- map_lgl(
Expand Down
2 changes: 1 addition & 1 deletion R/tar_exist_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
#' @examples
#' tar_exist_process()
tar_exist_process <- function(store = targets::tar_config_get("store")) {
tar_assert_allow_meta("tar_exist_process")
tar_assert_allow_meta("tar_exist_process", store)
file.exists(path_process(path_store = store))
}
2 changes: 1 addition & 1 deletion R/tar_exist_progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
#' @examples
#' tar_exist_progress()
tar_exist_progress <- function(store = targets::tar_config_get("store")) {
tar_assert_allow_meta("tar_exist_progress")
tar_assert_allow_meta("tar_exist_progress", store)
file.exists(path_progress(path_store = store))
}
1 change: 0 additions & 1 deletion R/tar_exist_script.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
#' @examples
#' tar_exist_script()
tar_exist_script <- function(script = targets::tar_config_get("script")) {
tar_assert_allow_meta("tar_exist_script")
file.exists(script)
}
2 changes: 1 addition & 1 deletion R/tar_glimpse.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ tar_glimpse <- function(
script = targets::tar_config_get("script"),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_glimpse")
tar_assert_allow_meta("tar_glimpse", store)
force(envir)
tar_assert_package("visNetwork")
tar_assert_lgl(targets_only)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_invalidate.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#' })
#' }
tar_invalidate <- function(names, store = targets::tar_config_get("store")) {
tar_assert_allow_meta("tar_invalidate")
tar_assert_allow_meta("tar_invalidate", store)
meta <- meta_init(path_store = store)
data <- meta$database$read_condensed_data()
tar_message_meta(store = store)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_load.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tar_load <- function(
envir = parent.frame(),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_load")
tar_assert_allow_meta("tar_load", store)
tar_assert_store(store = store)
force(meta)
force(envir)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_load_everything.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tar_load_everything <- function(
envir = parent.frame(),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_load_everything")
tar_assert_allow_meta("tar_load_everything", store)
force(envir)
tar_load(
everything(),
Expand Down
2 changes: 1 addition & 1 deletion R/tar_load_globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tar_load_globals <- function(
envir = parent.frame(),
script = targets::tar_config_get("script")
) {
tar_assert_allow_meta("tar_load_globals")
tar_assert_allow_meta("tar_load_globals", store)
force(envir)
tar_assert_script(script)
eval(parse(file = script), envir = envir)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_load_raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tar_load_raw <- function(
envir = parent.frame(),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_load_raw")
tar_assert_allow_meta("tar_load_raw", store)
tar_assert_store(store = store)
force(meta)
force(envir)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_make.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ tar_make <- function(
use_crew = targets::tar_config_get("use_crew"),
terminate_controller = TRUE
) {
tar_assert_allow_meta("tar_make")
tar_assert_allow_meta("tar_make", store)
force(envir)
tar_assert_scalar(shortcut)
tar_assert_lgl(shortcut)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_make_clustermq.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ tar_make_clustermq <- function(
# Cannot use multicore clustermq backend
# due to https://github.com/ropensci/targets/discussions/780
# nocov start
tar_assert_allow_meta("tar_make_clustermq")
tar_assert_allow_meta("tar_make_clustermq", store)
force(envir)
tar_assert_package("clustermq")
tar_assert_scalar(shortcut)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_make_future.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tar_make_future <- function(
store = targets::tar_config_get("store"),
garbage_collection = targets::tar_config_get("garbage_collection")
) {
tar_assert_allow_meta("tar_make_future")
tar_assert_allow_meta("tar_make_future", store)
force(envir)
tar_assert_package("future")
tar_assert_scalar(shortcut)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_manifest.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ tar_manifest <- function(
envir = parent.frame(),
script = targets::tar_config_get("script")
) {
tar_assert_allow_meta("tar_manifest")
tar_assert_allow_meta("tar_manifest", store)
force(envir)
tar_assert_lgl(drop_missing)
tar_assert_scalar(drop_missing)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ tar_meta <- function(
complete_only = FALSE,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_meta")
tar_assert_allow_meta("tar_meta", store)
tar_assert_scalar(store)
tar_assert_chr(store)
tar_assert_nzchar(store)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_newer.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tar_newer <- function(
inclusive = FALSE,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_newer")
tar_assert_allow_meta("tar_newer", store)
tar_assert_scalar(time)
tar_assert_inherits(time, "POSIXct")
tar_assert_scalar(inclusive)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tar_objects <- function(
cloud = TRUE,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_objects")
tar_assert_allow_meta("tar_objects", store)
if (!file.exists(store)) {
return(character(0))
}
Expand Down
2 changes: 1 addition & 1 deletion R/tar_older.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ tar_older <- function(
inclusive = FALSE,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_older")
tar_assert_allow_meta("tar_older", store)
tar_assert_scalar(time)
tar_assert_inherits(time, "POSIXct")
tar_assert_scalar(inclusive)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_outdated.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ tar_outdated <- function(
script = targets::tar_config_get("script"),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_outdated")
tar_assert_allow_meta("tar_outdated", store)
force(envir)
tar_assert_scalar(shortcut)
tar_assert_lgl(shortcut)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_poll.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tar_poll <- function(
fields = c("skipped", "started", "built", "errored", "canceled", "since"),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_poll")
tar_assert_allow_meta("tar_poll", store)
start <- time_seconds()
if (!tar_exist_progress(store = store)) {
cli_blue_bullet(
Expand Down
2 changes: 1 addition & 1 deletion R/tar_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tar_process <- function(
names = NULL,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_process")
tar_assert_allow_meta("tar_process", store)
tar_assert_scalar(store)
tar_assert_chr(store)
tar_assert_nzchar(store)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_progress.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tar_progress <- function(
fields = "progress",
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_progress")
tar_assert_allow_meta("tar_progress", store)
tar_assert_scalar(store)
tar_assert_chr(store)
tar_assert_nzchar(store)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_progress_branches.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ tar_progress_branches <- function(
fields = NULL,
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_progress_branches")
tar_assert_allow_meta("tar_progress_branches", store)
tar_assert_scalar(store)
tar_assert_chr(store)
tar_assert_nzchar(store)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_progress_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tar_progress_summary <- function(
fields = c("skipped", "started", "built", "errored", "canceled", "since"),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_progress_summary")
tar_assert_allow_meta("tar_progress_summary", store)
tar_assert_scalar(store)
tar_assert_chr(store)
tar_assert_nzchar(store)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_prune.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tar_prune <- function(
script = targets::tar_config_get("script"),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_prune")
tar_assert_allow_meta("tar_prune", store)
force(envir)
tar_assert_callr_function(callr_function)
tar_assert_list(callr_arguments)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_prune_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tar_prune_list <- function(
script = targets::tar_config_get("script"),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_prune_list")
tar_assert_allow_meta("tar_prune_list", store)
force(envir)
tar_assert_callr_function(callr_function)
tar_assert_list(callr_arguments)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_read.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tar_read <- function(
meta = tar_meta(store = store),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_read")
tar_assert_allow_meta("tar_read", store)
tar_assert_store(store = store)
force(meta)
name <- tar_deparse_language(substitute(name))
Expand Down
2 changes: 1 addition & 1 deletion R/tar_read_raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tar_read_raw <- function(
meta = tar_meta(store = store),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_read_raw")
tar_assert_allow_meta("tar_read_raw", store)
tar_assert_store(store = store)
force(meta)
tar_assert_chr(name)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_renv.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tar_renv <- function(
envir = parent.frame(),
script = targets::tar_config_get("script")
) {
tar_assert_allow_meta("tar_renv")
tar_assert_allow_meta("tar_renv", store)
force(envir)
tar_assert_chr(extras)
tar_assert_chr(path)
Expand Down
2 changes: 1 addition & 1 deletion R/tar_reprex.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tar_reprex <- function(
run = tar_make(),
...
) {
tar_assert_allow_meta("tar_reprex")
tar_assert_allow_meta("tar_reprex", store)
tar_assert_package("reprex")
library <- "library(targets)"
pipeline <- as.call(list(quote(tar_script), substitute(pipeline)))
Expand Down
2 changes: 1 addition & 1 deletion R/tar_sitrep.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ tar_sitrep <- function(
script = targets::tar_config_get("script"),
store = targets::tar_config_get("store")
) {
tar_assert_allow_meta("tar_sitrep")
tar_assert_allow_meta("tar_sitrep", store)
force(envir)
names_quosure <- rlang::enquo(names)
fields_quosure <- rlang::enquo(fields)
Expand Down
Loading

0 comments on commit c9127ba

Please sign in to comment.