From 79707cccc8cb2cc4fa8c2ac24701f271aecaa702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Wed, 11 Sep 2024 08:41:08 -0600 Subject: [PATCH] Change S3 list_contents implementation --- singer_sdk/contrib/filesystem/s3.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/singer_sdk/contrib/filesystem/s3.py b/singer_sdk/contrib/filesystem/s3.py index 4f7816596..423385517 100644 --- a/singer_sdk/contrib/filesystem/s3.py +++ b/singer_sdk/contrib/filesystem/s3.py @@ -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):