-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Document difference between S3 object copy
vs copy_from
vs copy_object
#3051
Comments
Hi @mdavis-xyz, That's a good point— Both The easiest copy for
Hope this helps! |
Can we add a new copy method to s3.Object? One that copies from this object to another? It seems silly to bother having high-level resources, but then to copy you have to extract the low level client from the service resource or object resource, and then extract not one but two identifiers from the high level resource to pass to the low level call, in a way that is inconsistent with the way that the destination object is passed to the call. This is quite clunky and verbose. We should be able to do:
but default the destination bucket to the source bucket if omitted:
And also:
|
The documentation for the low level copy is also a bit confusing. The S3 client has And why do they use:
Instead of
? |
Hi @mdavis-xyz, I was able to confirm with the team that the resource For the low-level copy itself, it's
and customization over s3Transfer, which is why you need to access the meta client to use it. |
Hmm, I'm still not understanding the difference. How is Are you saying that the difference is that |
Hi @mdavis-xyz, I thought initially this was a special case where the meta client was needed and that's why it was documented, but that doesn't appear to be the case— seems to work fine on a standard client as well. And yes, the meta client is just a way to access a service's client from a resource instantiation. Correct, |
copy
vs eiifccugvrnu`hjruceefecbgdgiriicirktbgerrhhdncopy_from vs copy_object
copy
vs eiifccugvrnu`hjruceefecbgdgiriicirktbgerrhhdncopy_from vs copy_objectcopy
vs copy_from
vs copy_object
I can't seem to get either to preserve my metadata. (Specifically, LastModified.) |
I too was confused between copy() and copy_object(). I thought the obvious one to use was copy() and started using that one, just to realize that copy_object() is much faster, at least for small files (the situation I tested). In my experience copy_object() is 50% faster for a single process - if you use multiple parallel processes the effect is larger. |
which one support copy 'LastModified' |
s3.Object
has methodscopy
andcopy_from
.Based on the name, I assumed that
copy_from
would copy from some other key into the key (and bucket) of thiss3.Object
. Therefore I assume that the other copy function would to the opposite. i.e. copy from thiss3.Object
to another object. Or maybe the two are the other way around.But after reading the docs for both, it looks like they both do the same thing. They both copy from another object into this object. Is that correct? What's the point of having two functions that copy in the same direction?
What I want is to copy the existing
s3.Object
into a different path. I don't want to have to manually instantiate a seconds3.Object
instance in python, and then pass the bucket and key manually from the first.i.e. what's the easiest way to copy
s3://bucketA/pathA.txt
tos3://bucketB/pathB.txt
, if I already haves3.Object('bucketA','pathA.txt')
?The text was updated successfully, but these errors were encountered: