Hello! I have a very basic case: I want to list all folders in a minio (s3) bucket. Then make parallel tasks that count the number of files in each folder.
Can I achieve that via blocks? I see that the S3 block only has
get_folder
which will download the whole storage to my local drive. I don’t want that.
I see two alternative ways:
• Make an S3 block, use that.
• Make a secret block, in my code set up a minio connection, use that.
Which one is better?
✅ 1
r
Ryan Peden
11/02/2022, 4:41 PM
The built-in S3 block is meant to be used for remote code storage, so it's probably not the best fit for this.
The prefect-aws collection has an S3Bucket block with a few more capabilities - the s3_list_objects method might do what you want. The block can use MinIO credentials, too.
b
Boris Tseytlin
11/02/2022, 5:03 PM
s3_list_objects
for some reason started listing everything recursively 😞
Boris Tseytlin
11/02/2022, 5:04 PM
I came up with this. It works, but at this point I could be establishing my own connection, only using blocks to store secrets.
Am I doing it right?
Boris Tseytlin
11/02/2022, 5:05 PM
Seems like listing folders in a bucket should be a very common and straightforward thing to do
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.