From 39e062132b04369509ff1edc438c4ead9e05f8ae Mon Sep 17 00:00:00 2001 From: Remy Gwaramadze Date: Mon, 22 Sep 2025 15:29:41 +0200 Subject: [PATCH] Fix NoSuchKey errors --- quixstreams/sources/community/file/s3.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quixstreams/sources/community/file/s3.py b/quixstreams/sources/community/file/s3.py index 8cf8f8149..f181b913b 100644 --- a/quixstreams/sources/community/file/s3.py +++ b/quixstreams/sources/community/file/s3.py @@ -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))[