Xuanwo commented on code in PR #9421:
URL: https://github.com/apache/opendal/pull/9421#discussion_r4736327156
##########
bindings/python/src/operator.rs:
##########
@@ -143,8 +145,15 @@ fn extract_delete_paths(paths: &Bound<'_, PyAny>) ->
PyResult<Vec<String>> {
paths
.try_iter()?
.map(|entry| {
- let path = entry?.extract::<PathBuf>()?;
- Ok(path.to_string_lossy().into_owned())
+ let entry = entry?;
+ let (path, opts) = match entry.cast::<PyTuple>() {
Review Comment:
Thanks for fixing the `ScopedPath` case in e31ba518. Both sync and async
`delete_many` now use the path returned by `__fspath__`. When `__fspath__`
raises, the base wheel propagates the exception and leaves the whole batch
intact. This revision tries to unpack a tuple after any path extraction error,
so it can swallow that exception and proceed with deletion.
Could you reserve `(path, options)` for entries that do not support the path
protocol and cover the failure case on both the sync and async operators? The
tests should assert that the exception from `__fspath__` reaches the caller and
every object in the batch remains intact.
*AI-generated review reply.*
--
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]