alamb commented on code in PR #549:
URL:
https://github.com/apache/arrow-rs-object-store/pull/549#discussion_r2614182351
##########
src/lib.rs:
##########
@@ -1306,6 +1298,24 @@ where
Ok(self.get_opts(location, options).await?.meta)
}
+ async fn delete(&self, location: &Path) -> Result<()> {
+ let location = location.clone();
+ let mut stream =
+ self.delete_stream(futures::stream::once(async move { Ok(location)
}).boxed());
+ let _path = stream.try_next().await?.ok_or_else(|| Error::Generic {
+ store: "ext",
+ source: "`delete_stream` was supposed to yield once but
didn't".into(),
+ })?;
+ if stream.next().await.is_some() {
Review Comment:
👍
##########
src/lib.rs:
##########
@@ -1306,6 +1298,24 @@ where
Ok(self.get_opts(location, options).await?.meta)
}
+ async fn delete(&self, location: &Path) -> Result<()> {
+ let location = location.clone();
+ let mut stream =
+ self.delete_stream(futures::stream::once(async move { Ok(location)
}).boxed());
+ let _path = stream.try_next().await?.ok_or_else(|| Error::Generic {
+ store: "ext",
+ source: "`delete_stream` was supposed to yield once but
didn't".into(),
Review Comment:
Maybe it would help to explain why the stream was supposed to yield once
```suggestion
source: "`delete_stream` with one location should yield once but
didn't".into(),
```
##########
src/lib.rs:
##########
@@ -1306,6 +1298,24 @@ where
Ok(self.get_opts(location, options).await?.meta)
}
+ async fn delete(&self, location: &Path) -> Result<()> {
+ let location = location.clone();
+ let mut stream =
+ self.delete_stream(futures::stream::once(async move { Ok(location)
}).boxed());
+ let _path = stream.try_next().await?.ok_or_else(|| Error::Generic {
+ store: "ext",
+ source: "`delete_stream` was supposed to yield once but
didn't".into(),
+ })?;
+ if stream.next().await.is_some() {
+ Err(Error::Generic {
+ store: "ext",
+ source: "`delete_stream` yielded more than once".into(),
Review Comment:
```suggestion
source: "`delete_stream` with one location expected to yield
exactly once, but yielded more than once".into(),
```
--
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]