From 6c7eccf5fd929351144989c9f6a9fa40eff2417c Mon Sep 17 00:00:00 2001 From: OrangeCube Date: Tue, 8 Dec 2020 19:00:20 +0800 Subject: [PATCH] remote: fix pull error for large file with aliyun-oss (#5053) Fixes #5051 Co-authored-by: Gary Yuan --- dvc/tree/oss.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dvc/tree/oss.py b/dvc/tree/oss.py index 3e0a3d477..ade5f2418 100644 --- a/dvc/tree/oss.py +++ b/dvc/tree/oss.py @@ -128,6 +128,11 @@ class OSSTree(BaseTree): # pylint:disable=abstract-method self, from_info, to_file, name=None, no_progress_bar=False, **_kwargs ): with Tqdm(desc=name, disable=no_progress_bar, bytes=True) as pbar: - self.oss_service.get_object_to_file( - from_info.path, to_file, progress_callback=pbar.update_to + import oss2 + + oss2.resumable_download( + self.oss_service, + from_info.path, + to_file, + progress_callback=pbar.update_to, )