Skip to content

Commit 8148835

Browse files
committed
ci fixes
1 parent 507dab5 commit 8148835

File tree

8 files changed

+16
-15
lines changed

8 files changed

+16
-15
lines changed

dvc/fs/hdfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def info(self, path_info):
229229

230230
def checksum(self, path_info):
231231
return HashInfo(
232-
"checksum",
232+
HashName.CHECKSUM.value,
233233
_hadoop_fs_checksum(path_info),
234234
size=self.getsize(path_info),
235235
)

dvc/fs/memory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def __init__(self, repo, config):
1515
self.fs = MemFS()
1616

1717
def exists(self, path_info, use_dvcignore=True):
18-
return self.fs.exists(path_info.path)
18+
return self.fs.exists(path_info.fspath)
1919

2020
def open(self, path_info, mode="r", encoding=None, **kwargs):
2121
return self.fs.open(

dvc/fs/webhdfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def info(self, path_info):
127127

128128
def checksum(self, path_info):
129129
return HashInfo(
130-
HashName.CHECKSUM,
130+
HashName.CHECKSUM.value,
131131
self.hdfs_client.checksum(path_info.path)["bytes"],
132132
size=self.hdfs_client.status(path_info.path)["length"],
133133
)

dvc/utils/serialize/_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ class ParseError(DvcException):
3939
"""Errors while parsing files"""
4040

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

44-
path = relpath(path)
45+
path = path if isinstance(path, URLInfo) else relpath(path)
4546
super().__init__(f"unable to read: '{path}', {message}")
4647

4748

tests/func/test_checkout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ def test(self):
312312
class TestCheckoutMissingMd5InStageFile(TestRepro):
313313
def test(self):
314314
d = load_yaml(self.file1_stage)
315-
del d[Stage.PARAM_OUTS][0][LocalFileSystem.hash_name]
316-
del d[Stage.PARAM_DEPS][0][LocalFileSystem.hash_name]
315+
del d[Stage.PARAM_OUTS][0][LocalFileSystem._DEFAULT_HASH]
316+
del d[Stage.PARAM_DEPS][0][LocalFileSystem._DEFAULT_HASH]
317317
dump_yaml(self.file1_stage, d)
318318

319319
with pytest.raises(CheckoutError):

tests/func/test_data_cloud.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,8 @@ def test_pipeline_file_target_ops(tmp_dir, dvc, run_copy, local_remote):
420420

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

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

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

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

439439
clean(TmpDir(path).iterdir())
440440
dvc.push(["dvc.yaml"])
441-
assert len(recurse_list_dir(path)) == 2
441+
assert len(recurse_list_dir(path)) == 3
442442

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

526526
dvc.push("copy-foo-bar")
527-
assert len(recurse_list_dir(local_remote.url)) == 1
527+
assert len(recurse_list_dir(local_remote.url)) == 2
528528
# pushing everything so as we can check pull/fetch only downloads
529529
# from specified targets
530530
dvc.push()

tests/func/test_repro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,8 +736,8 @@ def test(self):
736736
class TestReproMissingMd5InStageFile(TestRepro):
737737
def test(self):
738738
d = load_yaml(self.file1_stage)
739-
del d[Stage.PARAM_OUTS][0][LocalFileSystem.hash_name]
740-
del d[Stage.PARAM_DEPS][0][LocalFileSystem.hash_name]
739+
del d[Stage.PARAM_OUTS][0][LocalFileSystem._DEFAULT_HASH.value]
740+
del d[Stage.PARAM_DEPS][0][LocalFileSystem._DEFAULT_HASH.value]
741741
dump_yaml(self.file1_stage, d)
742742

743743
stages = self.dvc.reproduce(self.file1_stage)

tests/func/test_stage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def test_empty_list():
5555

5656
def test_list():
5757
lst = [
58-
{LocalOutput.PARAM_PATH: "foo", LocalFileSystem.hash_name: "123"},
59-
{LocalOutput.PARAM_PATH: "bar", LocalFileSystem.hash_name: None},
58+
{LocalOutput.PARAM_PATH: "foo", LocalFileSystem._DEFAULT_HASH: "123"},
59+
{LocalOutput.PARAM_PATH: "bar", LocalFileSystem._DEFAULT_HASH: None},
6060
{LocalOutput.PARAM_PATH: "baz"},
6161
]
6262
d = {Stage.PARAM_DEPS: lst}

0 commit comments

Comments
 (0)