Skip to content

Commit e71f300

Browse files
committed
try to fix cloud deletion error when recorded bucket is NA
1 parent b7f7c6d commit e71f300

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* Restore explicit references to "self" in `R6` classes.
44
* Perform `crew` task retries.
5+
* Try to handle `NA` buckets in `store_delete_objects.tar_aws()` and `store_delete_objects.tar_gcp()`.
56

67
# targets 1.10.0
78

R/class_aws.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ store_delete_objects.tar_aws <- function(store, meta, batch_size, verbose) {
183183
subset <- meta[meta$bucket_group == group,, drop = FALSE] # nolint
184184
example_path <- subset$path[[1L]]
185185
bucket <- store_aws_bucket(example_path)
186+
if (anyNA(example_path) || anyNA(bucket)) {
187+
next
188+
}
186189
region <- store_aws_region(example_path)
187190
endpoint <- store_aws_endpoint(example_path)
188191
objects <- map(

R/class_gcp.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ store_delete_objects.tar_gcp <- function(store, meta, batch_size, verbose) {
142142
for (index in seq_len(nrow(subset))) {
143143
example_path <- subset$path[[index]]
144144
bucket <- store_gcp_bucket(example_path)
145+
if (anyNA(example_path) || anyNA(bucket)) {
146+
next
147+
}
145148
key <- store_gcp_key(example_path)
146149
version <- store_gcp_version(example_path)
147150
message <- paste(

0 commit comments

Comments
 (0)