Skip to content

Commit

Permalink
Change S3 list_contents implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Sep 11, 2024
1 parent 8ea6652 commit 79707cc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions singer_sdk/contrib/filesystem/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ def list_contents(self) -> t.Generator[S3File | S3Directory, None, None]:
paginator = self._client.get_paginator("list_objects_v2")
for page in paginator.paginate(Bucket=self._bucket, Prefix=self._prefix):
for obj in page.get("Contents", []):
key = obj["Key"]
if key.endswith("/"):
yield S3Directory(self._client, self._bucket, key)
else:
yield S3File(self._client, self._bucket, key)
yield S3File(self._client, bucket=self._bucket, key=obj["Key"])


class S3FileSystem(base.AbstractFileSystem):
Expand Down

0 comments on commit 79707cc

Please sign in to comment.