5

I am trying to upload multiple files at once using the google cloud python api, and am having trouble with it. Below is my code:

client = storage.Client.from_service_account_json("path_to_json")
bucket = client.get_bucket(bucket_name)
with client.batch():
    for i in range(10):
        try:
            blob = bucket.blob("my_blob")
            blob.upload_from_filename("path_to_file",content_type="image/jpeg")
    except Exception as e:
        raise e

However, this is telling me that there are no deferred requests to make. I have tried doing it without client.batch() and it works but is too slow. I was wondering if anyone has ever encountered this.

Thanks

1 Answer 1

3

According to this issue, the back-end API doesn't support batching "media" operations

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.