-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3 upload_file() and upload_fileobj() do not return the object's ETag. #2861
Comments
Hi @toojays, Thanks for resurfacing this! Marking as a feature request for now. |
Hi @toojays and @stobrien89. I have submitted what I believe is a complete implementation for this. The solution is across two separate pull requests:
From what I can tell, due to the nature of the changes in both cases, I believe that the pull requests are not logically coupled and can be merged or released in any order, or independently. In other words, one does not require the other, but when both are released, you should get the desired behavior, i.e. a return value that contains the ETag for the uploaded entity when using I've never contributed to |
@adamsc64 would you be able to return the |
@matteofigus Possibly. But I want to keep this PR as simple as possible to get it through review. So unless it's necessary and related to the change, I probably would recommend keeping it as is for now. This doesn't mean there can't be a second PR with the additional information. Do people have opinions? |
Also, I'm getting complete silence on the two pull requests. Does anyone know how to officially request a pull request review from the boto team? |
So a fix has been ready for 2 years but nobody has reviewed or merged it? Is Boto3 actually maintained? This functionality is quite important for common S3 usecases such as passing an uploaded object reference to a consumer in a way that ensures the content hasn't changed since that upload. |
Describe the bug
When uploading an object to S3, the S3 server response includes the object's entity tag (ETag). Boto3's
put_object()
call returns this ETag. But theupload_file()
andupload_fileobj()
calls do not.Steps to reproduce
The output of this is just
None
, becauseupload_fileobj()
returns nothing.Expected behavior
Ideally the above code sequence would output some object containing the ETag.
For example, compare with
put_object()
:This outputs:
Workaround
Monkeypatching a couple of classes in s3transfer as described at boto/s3transfer#82 (comment) gets the response passed back from S3, and I can pull the ETag out of that.
The text was updated successfully, but these errors were encountered: