Skip to content

Commit 7f5e4a9

Browse files
authored
Merge pull request #3187 from iterative/pull-3186-restyled
Restyle s3: copy large objects without chunking
2 parents 4d49b6b + c3628c8 commit 7f5e4a9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dvc/remote/s3.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import logging
44
import os
55
import threading
6+
from boto3.s3.transfer import TransferConfig
67

78
from funcy import cached_property, wrap_prop
89

@@ -169,7 +170,13 @@ def _copy(cls, s3, from_info, to_info, extra_args):
169170
)
170171
else:
171172
source = {"Bucket": from_info.bucket, "Key": from_info.path}
172-
s3.copy(source, to_info.bucket, to_info.path, ExtraArgs=extra_args)
173+
s3.copy(
174+
source,
175+
to_info.bucket,
176+
to_info.path,
177+
ExtraArgs=extra_args,
178+
Config=TransferConfig(multipart_threshold=size + 1),
179+
)
173180

174181
cached_etag = cls.get_etag(s3, to_info.bucket, to_info.path)
175182
if etag != cached_etag:

0 commit comments

Comments
 (0)