From 13470eff47d1d4a87abe2ee398257fcb27b580ec Mon Sep 17 00:00:00 2001 From: wlandau-lilly Date: Tue, 7 Nov 2023 14:45:41 -0500 Subject: [PATCH] assert batch_size <= 1000 --- R/tar_delete.R | 5 ++++- R/tar_destroy.R | 1 + R/tar_prune.R | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/R/tar_delete.R b/R/tar_delete.R index a3f5d535..d07ee3c3 100644 --- a/R/tar_delete.R +++ b/R/tar_delete.R @@ -27,9 +27,11 @@ #' @param cloud Logical of length 1, whether to delete objects #' from the cloud if applicable (e.g. AWS, GCP). If `FALSE`, #' files are not deleted from the cloud. -#' @param batch_size Positive integer, number of target objects to delete +#' @param batch_size Positive integer between 1 and 1000, +#' number of target objects to delete #' from the cloud with each HTTP API request. #' Currently only supported for AWS. +#' Cannot be more than 1000. #' @param verbose Logical of length 1, whether to print console messages #' to show progress when deleting each batch of targets from each #' cloud bucket. Batched deletion with verbosity is currently only supported @@ -66,6 +68,7 @@ tar_delete <- function( tar_assert_scalar(batch_size) tar_assert_none_na(batch_size) tar_assert_ge(batch_size, 1L) + tar_assert_le(batch_size, 1000L) tar_assert_lgl(verbose) tar_assert_scalar(verbose) tar_assert_none_na(verbose) diff --git a/R/tar_destroy.R b/R/tar_destroy.R index 9558091c..41276342 100644 --- a/R/tar_destroy.R +++ b/R/tar_destroy.R @@ -101,6 +101,7 @@ tar_destroy <- function( tar_assert_scalar(batch_size) tar_assert_none_na(batch_size) tar_assert_ge(batch_size, 1L) + tar_assert_le(batch_size, 1000L) tar_assert_lgl(verbose) tar_assert_scalar(verbose) tar_assert_none_na(verbose) diff --git a/R/tar_prune.R b/R/tar_prune.R index 003a0fb0..dddf2dbb 100644 --- a/R/tar_prune.R +++ b/R/tar_prune.R @@ -56,6 +56,7 @@ tar_prune <- function( tar_assert_scalar(batch_size) tar_assert_none_na(batch_size) tar_assert_ge(batch_size, 1L) + tar_assert_le(batch_size, 1000L) tar_assert_lgl(verbose) tar_assert_scalar(verbose) tar_assert_none_na(verbose)