fsspec/s3fs

How to upload a list of files from local fs to cloud s3 fs async?

LuchiLucs opened this issue · 3 comments

After reading the documentation I understood that the API is internally async so I tried to call sync put with a list of files, but it fails:

def sync_upload_files(filenames: list[str]):
    s3 = s3fs.S3FileSystem(
        key=AWS_S3_ACCESS_KEY_ID,
        secret=AWS_S3_SECRET_ACCESS_KEY,
    )
    s3.put(filenames, AWS_S3_PREFIX)

Am I doing something wrong? Should I use the async fs/methods and perform an async for with the single put on each file?

tried to call sync put with a list of files, but it fails

Can you be more specific?

Yes, this is the normal way to call s3fs.

@martindurant It was my fault, I confused "cp" with "put" and was using "cp" before without noticing. After reading ffspec I understood they were the same, but maybe they are not.

Do you want me to delete or close the issue?

No worries