Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl ObjectStore for HdfsObjectStore {
let status_stream = self
.client
.list_status_iter(
&prefix.map(make_absolute_dir).unwrap_or("".to_string()),
&prefix.map(make_absolute_dir).unwrap_or("/".to_string()),
true,
)
.into_stream()
Expand Down
5 changes: 5 additions & 0 deletions tests/test_object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ mod test {
assert_eq!(list.len(), 1);
assert_eq!(list[0].as_ref().unwrap().location, Path::from("/testfile"));

// A list of None should be logically equivalent to /
let list: Vec<object_store::Result<ObjectMeta>> = store.list(None).collect().await;
assert_eq!(list.len(), 1);
assert_eq!(list[0].as_ref().unwrap().location, Path::from("/testfile"));

// Listing of a prefix that doesn't exist should return an empty result, not an error
assert_eq!(
store.list(Some(&Path::from("/doesnt/exist"))).count().await,
Expand Down
Loading