Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a bug in the _find #913

Merged
merged 1 commit into from
Nov 12, 2024
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 s3fs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,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 @@ -2498,6 +2498,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
Loading