Skip to content

Commit

Permalink
need full path for key
Browse files Browse the repository at this point in the history
  • Loading branch information
msmitherdc authored Aug 29, 2024
1 parent d020b0e commit 4214a50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cloudpathlib/s3/s3client.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _list_dir(self, cloud_path: S3Path, recursive=False) -> Iterable[Tuple[S3Pat
parent_canonical = prefix + str(parent).rstrip("/")
if parent_canonical not in yielded_dirs and str(parent) != ".":
path = self.CloudPath(f"s3://{cloud_path.bucket}/{parent_canonical}")
self._set_metadata_cache(cloud_path, "dir", etag, size, last_modified)
self._set_metadata_cache(path, "dir", etag, size, last_modified)
yield (
path,
True,
Expand All @@ -303,7 +303,7 @@ def _list_dir(self, cloud_path: S3Path, recursive=False) -> Iterable[Tuple[S3Pat
# s3 fake directories have 0 size and end with "/"
if result_key.get("Key").endswith("/") and result_key.get("Size") == 0:
path = self.CloudPath(f"s3://{cloud_path.bucket}/{canonical}")
self._set_metadata_cache(cloud_path, "dir", etag, size, last_modified)
self._set_metadata_cache(path, "dir", etag, size, last_modified)
yield (
path,
True,
Expand All @@ -313,7 +313,7 @@ def _list_dir(self, cloud_path: S3Path, recursive=False) -> Iterable[Tuple[S3Pat
# yield object as file
else:
path = self.CloudPath(f"s3://{cloud_path.bucket}/{result_key.get('Key')}")
self._set_metadata_cache(cloud_path, "file", etag, size, last_modified)
self._set_metadata_cache(path, "file", etag, size, last_modified)
yield (
path,
False,
Expand Down

0 comments on commit 4214a50

Please sign in to comment.