Skip to content

Commit

Permalink
try to fix cloud deletion error when recorded bucket is NA
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Jan 28, 2025
1 parent b7f7c6d commit e71f300
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

# targets 1.10.0

Expand Down
3 changes: 3 additions & 0 deletions R/class_aws.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ store_delete_objects.tar_aws <- function(store, meta, batch_size, verbose) {
subset <- meta[meta$bucket_group == group,, drop = FALSE] # nolint
example_path <- subset$path[[1L]]
bucket <- store_aws_bucket(example_path)
if (anyNA(example_path) || anyNA(bucket)) {
next
}
region <- store_aws_region(example_path)
endpoint <- store_aws_endpoint(example_path)
objects <- map(
Expand Down
3 changes: 3 additions & 0 deletions R/class_gcp.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ store_delete_objects.tar_gcp <- function(store, meta, batch_size, verbose) {
for (index in seq_len(nrow(subset))) {
example_path <- subset$path[[index]]
bucket <- store_gcp_bucket(example_path)
if (anyNA(example_path) || anyNA(bucket)) {
next
}
key <- store_gcp_key(example_path)
version <- store_gcp_version(example_path)
message <- paste(
Expand Down

0 comments on commit e71f300

Please sign in to comment.