From e29d903d986d685a8fc5b0c385555450fb2764b6 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 29 Sep 2020 06:10:15 +0300 Subject: [PATCH 1/2] gdrive: bring back the progress workaround --- dvc/tree/gdrive.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dvc/tree/gdrive.py b/dvc/tree/gdrive.py index 302a5ccda0..5e34fa4551 100644 --- a/dvc/tree/gdrive.py +++ b/dvc/tree/gdrive.py @@ -366,7 +366,10 @@ def _gdrive_upload_file( total=total, disable=no_progress_bar, ) as wrapped: - item.content = wrapped + # PyDrive doesn't like content property setting for empty files + # https://github.com/gsuitedevs/PyDrive/issues/121 + if total: + item.content = wrapped item.Upload() return item From 0c3ef05c2e707b99ed889c7a994cec42d3e22ba0 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 29 Sep 2020 05:48:22 +0300 Subject: [PATCH 2/2] WIP cloud: test empty files --- tests/func/test_data_cloud.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/func/test_data_cloud.py b/tests/func/test_data_cloud.py index 1fbaa70f06..c474935fd9 100644 --- a/tests/func/test_data_cloud.py +++ b/tests/func/test_data_cloud.py @@ -19,7 +19,17 @@ from dvc.utils.fs import move, remove from dvc.utils.serialize import dump_yaml, load_yaml -from .test_api import all_clouds +all_clouds = [ + pytest.lazy_fixture(cloud) + for cloud in ["s3", "gs", "azure", "gdrive", "ssh", "http"] +] + [ + pytest.param( + pytest.lazy_fixture("oss"), + marks=pytest.mark.xfail( + reason="https://github.com/iterative/dvc/issues/4633", + ), + ) +] @pytest.mark.parametrize("remote", all_clouds, indirect=True) @@ -35,6 +45,7 @@ def test_cloud(tmp_dir, dvc, remote): # pylint:disable=unused-argument "data_dir": { "data_sub_dir": {"data_sub": "data_sub"}, "data": "data", + "empty": "", } } ) @@ -128,6 +139,7 @@ def test_cloud_cli(tmp_dir, dvc, remote): "data_dir": { "data_sub_dir": {"data_sub": "data_sub"}, "data": "data", + "empty": "", } } )