Skip to content
Merged
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
4 changes: 3 additions & 1 deletion quixstreams/sources/community/file/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ def get_file_list(self, filepath: Union[str, Path]) -> Iterable[Path]:
yield from self.get_file_list(folder["Prefix"])

for file in resp.get("Contents", []):
yield Path(file["Key"])
# Skip folder-like objects (0-byte objects that represent S3 folder prefixes)
if file["Size"] > 0:
yield Path(file["Key"])

def read_file(self, filepath: Path) -> BytesIO:
data = self._client.get_object(Bucket=self._bucket, Key=str(filepath))[
Expand Down