diff --git a/dvc/repo/metrics/show.py b/dvc/repo/metrics/show.py index 93168fcb82..82ca5cfa4c 100644 --- a/dvc/repo/metrics/show.py +++ b/dvc/repo/metrics/show.py @@ -9,7 +9,12 @@ from dvc.repo import locked from dvc.repo.collect import StrPaths, collect from dvc.scm import NoSCMError -from dvc.utils import error_handler, errored_revisions, onerror_collect +from dvc.utils import ( + as_posix, + error_handler, + errored_revisions, + onerror_collect, +) from dvc.utils.collections import ensure_list from dvc.utils.serialize import load_path @@ -31,12 +36,12 @@ def _to_fs_paths(metrics: List[Output]) -> StrPaths: def _collect_top_level_metrics(repo): top_metrics = repo.index._top_metrics # pylint: disable=protected-access for dvcfile, metrics in top_metrics.items(): - wdir = repo.dvcfs.path.relpath( - repo.dvcfs.path.parent(dvcfile), repo.root_dir + wdir = repo.fs.path.relpath( + repo.fs.path.parent(dvcfile), repo.root_dir ) for file in metrics: - path = repo.dvcfs.path.join(wdir, file) - yield repo.dvcfs.path.normpath(path) + path = repo.fs.path.join(wdir, as_posix(file)) + yield repo.fs.path.normpath(path) def _collect_metrics(repo, targets, revision, recursive): diff --git a/dvc/repo/params/show.py b/dvc/repo/params/show.py index 685d3cef8d..f4a9b48c32 100644 --- a/dvc/repo/params/show.py +++ b/dvc/repo/params/show.py @@ -20,7 +20,12 @@ from dvc.scm import NoSCMError from dvc.stage import PipelineStage from dvc.ui import ui -from dvc.utils import error_handler, errored_revisions, onerror_collect +from dvc.utils import ( + as_posix, + error_handler, + errored_revisions, + onerror_collect, +) from dvc.utils.collections import ensure_list from dvc.utils.serialize import load_path @@ -38,12 +43,12 @@ def _is_params(dep: "Output"): def _collect_top_level_params(repo): top_params = repo.index._top_params # pylint: disable=protected-access for dvcfile, params in top_params.items(): - wdir = repo.dvcfs.path.relpath( - repo.dvcfs.path.parent(dvcfile), repo.root_dir + wdir = repo.fs.path.relpath( + repo.fs.path.parent(dvcfile), repo.root_dir ) for file in params: - path = repo.dvcfs.path.join(wdir, file) - yield repo.dvcfs.path.normpath(path) + path = repo.fs.path.join(wdir, as_posix(file)) + yield repo.fs.path.normpath(path) def _collect_configs(