mirror of
https://github.com/run-llama/llama-hub.git
synced 2025-11-09 14:24:08 +00:00
skip folders in s3
This commit is contained in:
parent
adaa2d78a6
commit
8948cff28d
@ -75,6 +75,8 @@ class S3Reader(BaseReader):
|
|||||||
else:
|
else:
|
||||||
bucket = s3.Bucket(self.bucket)
|
bucket = s3.Bucket(self.bucket)
|
||||||
for obj in bucket.objects.filter(Prefix=self.prefix):
|
for obj in bucket.objects.filter(Prefix=self.prefix):
|
||||||
|
if obj.key.endswith("/"): # skip folders
|
||||||
|
continue
|
||||||
suffix = Path(obj.key).suffix
|
suffix = Path(obj.key).suffix
|
||||||
filepath = (
|
filepath = (
|
||||||
f"{temp_dir}/{next(tempfile._get_candidate_names())}{suffix}"
|
f"{temp_dir}/{next(tempfile._get_candidate_names())}{suffix}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user