mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
render.match: Skip errored revisions in get_files
This commit is contained in:
+6
-2
@@ -10,8 +10,12 @@ if TYPE_CHECKING:
|
||||
|
||||
|
||||
def get_files(plots_data: Dict) -> List:
|
||||
values = dpath.util.values(plots_data, ["*", "*"])
|
||||
return sorted({key for submap in values for key in submap.keys()})
|
||||
files = set()
|
||||
for rev in plots_data.keys():
|
||||
for file in plots_data[rev].get("data", {}).keys():
|
||||
files.add(file)
|
||||
sorted_files = sorted(files)
|
||||
return sorted_files
|
||||
|
||||
|
||||
def group_by_filename(plots_data: Dict) -> Dict:
|
||||
|
||||
@@ -1,10 +1,22 @@
|
||||
from dvc.render.match import (
|
||||
get_files,
|
||||
group_by_filename,
|
||||
match_renderers,
|
||||
squash_plots_properties,
|
||||
)
|
||||
|
||||
|
||||
def test_get_files_on_error():
|
||||
plots_data = {
|
||||
"v2": {"error": "ERROR"},
|
||||
"v1": {
|
||||
"data": {"file.json": {"data": [{"y": 2}, {"y": 3}], "props": {}}}
|
||||
},
|
||||
}
|
||||
files = get_files(plots_data)
|
||||
assert files == ["file.json"]
|
||||
|
||||
|
||||
def test_group_by_filename():
|
||||
error = FileNotFoundError()
|
||||
data = {
|
||||
|
||||
Reference in New Issue
Block a user