Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dvc/tree/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 13 additions & 1 deletion tests/func/test_data_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately gdrive is not setup yet on the GHA, we have it on our todo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, forgot hdfs 🤦‍♂️ It is broken though on gha.

] + [
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)
Expand All @@ -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": "",
}
}
)
Expand Down Expand Up @@ -128,6 +139,7 @@ def test_cloud_cli(tmp_dir, dvc, remote):
"data_dir": {
"data_sub_dir": {"data_sub": "data_sub"},
"data": "data",
"empty": "",
}
}
)
Expand Down