hcrosse opened a new pull request, #922:
URL: https://github.com/apache/arrow-rs-object-store/pull/922

   # Which issue does this PR close?
   
   Closes #920.
   
   # Rationale for this change
   
   `S3Client::bulk_delete_request` panics on `.unwrap()` if a `<DeleteResult>` 
contains an `<Error><Key>` not present in the request batch, and only updates 
the first matching slot when a batch contains duplicate failing keys, returning 
false `Ok` results for later duplicates.
   
   # What changes are included in this PR?
   
   - Replace `paths.iter().find_position(...).unwrap()` in 
[`src/aws/client.rs`](https://github.com/apache/arrow-rs-object-store/blob/main/src/aws/client.rs#L625)
 with a lazily initialized `HashMap<&Path, Vec<usize>>` built on the first 
`<Error>` entry.
   - Return `Error::InvalidDeleteObjectsResponse` when an `<Error><Key>` does 
not match any requested path (using the existing `Path::parse` matching).
   - Populate every matching index in `results` for duplicate failing keys.
   - Remove the unused `itertools::Itertools` import and add unit tests in 
`src/aws/client.rs`.
   
   # Are there any user-facing changes?
   
   No public API changes. Unknown `<Error><Key>` entries now return an error 
instead of panicking, and duplicate failing keys in `delete_stream` no longer 
return false `Ok` entries.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to