The lower-level Bucket.put and Object.put methods do return responses, as per https://boto3.readthedocs.io/en/latest/reference/services/s3.html, but the higher-level methods do not, annoyingly. I have verified this is the case with actual code. Is there any rationale behind this, or was it oversight?
These higher level commands can be made up of several lower level commands, sometimes of different types, so there is not one set of response data, or even one type of response to return in all cases, and wouldn't make sense to try and merge them or show it all, so to keep it clean we don't return any of the individual responses.
Really? What REST operation would Object.upload_file do other than a PUT? Surely the ID for the object could be returned, at the very least?
The upload_file method could perform multipart upload based on size thresholds. In this case there are multiple responses from S3 from varying operations (InitiateMultipartUpload, UploadPart, CompleteMultipartUpload) so it's not clear which responses we should be returning. Let us know if you have any more questions.
The ID would be the same for all of them though. It makes sense to return the ID at the very least.
@jamesls No?
I'm in the same situation too. We rely on upload_file() method because of the benefits that it offers, specially regarding mutipart and retries, but when we work with versioned buckets, the method does not return the VersionID of the just uploaded file which makes working with large files and versioning difficult.
Most helpful comment
I'm in the same situation too. We rely on upload_file() method because of the benefits that it offers, specially regarding mutipart and retries, but when we work with versioned buckets, the method does not return the VersionID of the just uploaded file which makes working with large files and versioning difficult.