Skip to content

Commit

Permalink
fix a bug in the (#913)
Browse files Browse the repository at this point in the history
Co-authored-by: Jason <[email protected]>
  • Loading branch information
chorng and Jason authored Nov 12, 2024
1 parent 78249af commit b6a0095
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ async def _find(
# return super().find(path)
# # else: we refresh anyway, having at least two missing trees
out = await self._lsdir(path, delimiter="", prefix=prefix, **kwargs)
if not out and key:
if (not out and key) and not prefix:
try:
out = [await self._info(path)]
except FileNotFoundError:
Expand Down
1 change: 1 addition & 0 deletions s3fs/tests/test_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,7 @@ def test_find_with_prefix(s3):
s3.touch(test_bucket_name + "/prefixes2")
assert len(s3.find(test_bucket_name + "/prefixes")) == 100
assert len(s3.find(test_bucket_name, prefix="prefixes")) == 101
assert len(s3.find(test_bucket_name + "/prefixes", prefix="test2_")) == 0

assert len(s3.find(test_bucket_name + "/prefixes/test_")) == 0
assert len(s3.find(test_bucket_name + "/prefixes", prefix="test_")) == 100
Expand Down

0 comments on commit b6a0095

Please sign in to comment.