Hi everyone — I’m trying to use the prefect S3List...
# ask-community
b
Hi everyone — I’m trying to use the prefect S3List task but I’m struggling with the AWS authentication, since it appears the S3List task doesn’t accept boto_kwargs nor a boto_session, and I need to specify different profiles for my task. Has anyone faced this problem before?
k
Hi @Bruno Murino, I have not seen people use this Task before. Most of our Task Library is community contributed and is left at a very general level so it may not always fit you needs. In this case, I would just use boto3 directly and make a task like:
Copy code
@task
def get_images() -> List[str]:
    s3 = boto3.resource('s3', region_name='us-east-2')
    bucket = s3.Bucket('label-studio-raw-images')
    images = []
    for bucket_object in bucket.objects.all():
        images.append(bucket_object.key)
    return images
b
yea that’s what I ended up doing, thanks!
👍 1
k
If you feel the task library can be better, contributions are most welcome 🙂
b
yea I’ll definitely try and contribute! 🙂
👍 1