Skip to content

Commit

Permalink
ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrowla committed Feb 15, 2021
1 parent 507dab5 commit 8148835
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dvc/fs/hdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def info(self, path_info):

def checksum(self, path_info):
return HashInfo(
"checksum",
HashName.CHECKSUM.value,
_hadoop_fs_checksum(path_info),
size=self.getsize(path_info),
)
Expand Down
2 changes: 1 addition & 1 deletion dvc/fs/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, repo, config):
self.fs = MemFS()

def exists(self, path_info, use_dvcignore=True):
return self.fs.exists(path_info.path)
return self.fs.exists(path_info.fspath)

def open(self, path_info, mode="r", encoding=None, **kwargs):
return self.fs.open(
Expand Down
2 changes: 1 addition & 1 deletion dvc/fs/webhdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def info(self, path_info):

def checksum(self, path_info):
return HashInfo(
HashName.CHECKSUM,
HashName.CHECKSUM.value,
self.hdfs_client.checksum(path_info.path)["bytes"],
size=self.hdfs_client.status(path_info.path)["length"],
)
Expand Down
3 changes: 2 additions & 1 deletion dvc/utils/serialize/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class ParseError(DvcException):
"""Errors while parsing files"""

def __init__(self, path: "AnyPath", message: str):
from dvc.path_info import URLInfo
from dvc.utils import relpath

path = relpath(path)
path = path if isinstance(path, URLInfo) else relpath(path)
super().__init__(f"unable to read: '{path}', {message}")


Expand Down
4 changes: 2 additions & 2 deletions tests/func/test_checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ def test(self):
class TestCheckoutMissingMd5InStageFile(TestRepro):
def test(self):
d = load_yaml(self.file1_stage)
del d[Stage.PARAM_OUTS][0][LocalFileSystem.hash_name]
del d[Stage.PARAM_DEPS][0][LocalFileSystem.hash_name]
del d[Stage.PARAM_OUTS][0][LocalFileSystem._DEFAULT_HASH]
del d[Stage.PARAM_DEPS][0][LocalFileSystem._DEFAULT_HASH]
dump_yaml(self.file1_stage, d)

with pytest.raises(CheckoutError):
Expand Down
10 changes: 5 additions & 5 deletions tests/func/test_data_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ def test_pipeline_file_target_ops(tmp_dir, dvc, run_copy, local_remote):

outs = ["foo", "bar", "lorem", "ipsum", "baz", "lorem2"]

# each one's a copy of other, hence 3
assert len(recurse_list_dir(path)) == 3
# each one's a copy of other, hence 3 (plus odb config file)
assert len(recurse_list_dir(path)) == 4

clean(outs, dvc)
assert set(dvc.pull(["dvc.yaml"])["added"]) == {"lorem2", "baz"}
Expand All @@ -434,11 +434,11 @@ def test_pipeline_file_target_ops(tmp_dir, dvc, run_copy, local_remote):

clean(TmpDir(path).iterdir())
dvc.push(["dvc.yaml:copy-ipsum-baz"])
assert len(recurse_list_dir(path)) == 1
assert len(recurse_list_dir(path)) == 2

clean(TmpDir(path).iterdir())
dvc.push(["dvc.yaml"])
assert len(recurse_list_dir(path)) == 2
assert len(recurse_list_dir(path)) == 3

with pytest.raises(StageNotFound):
dvc.push(["dvc.yaml:StageThatDoesNotExist"])
Expand Down Expand Up @@ -524,7 +524,7 @@ def test_push_pull_fetch_pipeline_stages(tmp_dir, dvc, run_copy, local_remote):
run_copy("foo", "bar", no_commit=True, name="copy-foo-bar")

dvc.push("copy-foo-bar")
assert len(recurse_list_dir(local_remote.url)) == 1
assert len(recurse_list_dir(local_remote.url)) == 2
# pushing everything so as we can check pull/fetch only downloads
# from specified targets
dvc.push()
Expand Down
4 changes: 2 additions & 2 deletions tests/func/test_repro.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,8 @@ def test(self):
class TestReproMissingMd5InStageFile(TestRepro):
def test(self):
d = load_yaml(self.file1_stage)
del d[Stage.PARAM_OUTS][0][LocalFileSystem.hash_name]
del d[Stage.PARAM_DEPS][0][LocalFileSystem.hash_name]
del d[Stage.PARAM_OUTS][0][LocalFileSystem._DEFAULT_HASH.value]
del d[Stage.PARAM_DEPS][0][LocalFileSystem._DEFAULT_HASH.value]
dump_yaml(self.file1_stage, d)

stages = self.dvc.reproduce(self.file1_stage)
Expand Down
4 changes: 2 additions & 2 deletions tests/func/test_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def test_empty_list():

def test_list():
lst = [
{LocalOutput.PARAM_PATH: "foo", LocalFileSystem.hash_name: "123"},
{LocalOutput.PARAM_PATH: "bar", LocalFileSystem.hash_name: None},
{LocalOutput.PARAM_PATH: "foo", LocalFileSystem._DEFAULT_HASH: "123"},
{LocalOutput.PARAM_PATH: "bar", LocalFileSystem._DEFAULT_HASH: None},
{LocalOutput.PARAM_PATH: "baz"},
]
d = {Stage.PARAM_DEPS: lst}
Expand Down

0 comments on commit 8148835

Please sign in to comment.