mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-13 07:18:25 +01:00
Force sorted order in plots rendering (#6601)
* Force sorted order in plots * Fix type hint * Fixed mypy * Updates test_plots * Removed reduntant test * Removed unused import
This commit is contained in:
+4
-3
@@ -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]:
|
||||
|
||||
@@ -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"),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user