While trying to use `S3List` with `prefix` and `de...
# prefect-community
a
While trying to use
S3List
with
prefix
and
delimiter
(trying to list "folders" in an S3prefix, say) I get an empty array:
Copy code
S3List(config['input_bucket_name']).run(prefix=test, delimiter="/", max_items=10)
If I run it manually using boto, I'm able to get results:
Copy code
import boto3

    client = boto3.client('s3')
    paginator = client.get_paginator('list_objects')
    result = paginator.paginate(Bucket=config['input_bucket_name'], Delimiter='/', Prefix=test)
    for prefix in result.search('CommonPrefixes'):
        print(prefix.get('Prefix'))
Is this expected behavior?
Looking at the code, one solution would be have a way to get the
CommonPrefixes
rather than the
Contents
(or get both)
n
That's a good flag @Alex Joseph - would you mind opening a PR to the
S3List
task for that? 🙂
a
I'm just getting my head around the code, will definitely put a PR once I'm comfortable 🙂