-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure we return a sorted listing when using a local client (#344)
This ensures that calls to `list_files` are returned sorted if a `LocalFileSystem` `ObjectStore` is used. It's not clean for a few reasons: 1. We have to materialize the entire iter in order to sort it 2. We can't easily detect if we're local just by using `type_of` or similar. We have a foreign trait object that doesn't have an `as_any` on it, so we can force the reference into an `Any` which would allow us to use [`is`](https://doc.rust-lang.org/std/any/trait.Any.html#method.is), and we can't _add_ an implementation of something like `as_any` because `dyn ObjectStore` isn't `Sized`. So this resorts to `format`ing the object at creation (since `ObjectStore` requires `Display`) and checking if it starts with `LocalFileSystem`.... Adds a test that when using local client things come back sorted now. Without these changes the test failed. I think we should merge (or something like it) and then also see about adding a `list_sorted` and `list_with_offset_sorted` to `ObjectStore` --------- Co-authored-by: Nick Lanham <[email protected]>
- Loading branch information
Showing
4 changed files
with
116 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters