stayrascal commented on code in PR #324:
URL:
https://github.com/apache/arrow-rs-object-store/pull/324#discussion_r2041116481
##########
src/lib.rs:
##########
@@ -720,7 +721,22 @@ pub trait ObjectStore: std::fmt::Display + Send + Sync +
Debug + 'static {
/// `foo/bar_baz/x`. List is recursive, i.e. `foo/bar/more/x` will be
included.
///
/// Note: the order of returned [`ObjectMeta`] is not guaranteed
- fn list(&self, prefix: Option<&Path>) -> BoxStream<'static,
Result<ObjectMeta>>;
+ fn list(&self, prefix: Option<&Path>) -> BoxStream<'static,
Result<ObjectMeta>> {
+ self.list_opts(prefix, ListOpts::default())
+ .map_ok(|r| futures::stream::iter(r.objects.into_iter().map(Ok)))
+ .try_flatten()
+ .boxed()
+ }
+
+ /// List all the objects with given options defined in [`ListOpts`]
+ ///
+ /// Prefixes are evaluated on a path segment basis, i.e. `foo/bar` is a
prefix of `foo/bar/x` but not of
+ /// `foo/bar_baz/x`. List is recursive, i.e. `foo/bar/more/x` will be
included.
+ fn list_opts(
Review Comment:
Sorry for I didn't get "this is a breaking change" here, do you mean maybe
some other crates import the object_store crate and implement the ObjectStore
traits, they have to implement the `list_opts` method if they upgrade the
object_store version, right? If it is, it might be problem, provide a default
implementation is a better option, but it also means we cannot remove other
list methods to make this trait more concise.
I planed marked other list methods as deprecated, it seems that it's better
to do it in a big version.
--
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]