diff --git a/dvc/render/utils.py b/dvc/render/utils.py index c9f227c79..6734ac65d 100644 --- a/dvc/render/utils.py +++ b/dvc/render/utils.py @@ -1,13 +1,14 @@ import os.path -from typing import Dict, List, Set +from typing import Dict, List -def get_files(data: Dict) -> Set: +def get_files(data: Dict) -> List: files = set() for rev in data.keys(): for file in data[rev].get("data", {}).keys(): files.add(file) - return files + sorted_files = sorted(files) + return sorted_files def group_by_filename(plots_data: Dict) -> List[Dict]: diff --git a/tests/unit/test_plots.py b/tests/unit/test_plots.py index 49ec95f58..306cb822c 100644 --- a/tests/unit/test_plots.py +++ b/tests/unit/test_plots.py @@ -28,9 +28,9 @@ def test_plots_order(tmp_dir, dvc): name="stage2", ) - assert get_files(dvc.plots.show()) == { + assert get_files(dvc.plots.show()) == [ "p.json", - os.path.join("sub", "p4.json"), "p1.json", os.path.join("sub", "p3.json"), - } + os.path.join("sub", "p4.json"), + ]