studio: Don't fail on empty params.

This commit is contained in:
David de la Iglesia Castro
2023-03-31 19:23:40 +02:00
parent 086d51d9de
commit d2812fa48f
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -340,6 +340,6 @@ def to_studio_params(dvc_params):
return result
for rev_data in dvc_params.values():
for file_name, file_data in rev_data.get("data", {}).items():
result[file_name] = file_data["data"]
result[file_name] = file_data.get("data", {})
return result
@@ -62,6 +62,10 @@ def test_run_check_ref_format(scm, name, result):
{"workspace": {"data": {"params.yaml": {"data": {"foo": 1}}}}},
{"params.yaml": {"foo": 1}},
),
(
{"workspace": {"data": {"params.yaml": {"error": "FileNotFound"}}}},
{"params.yaml": {}},
),
(
{"workspace": {"error": "something went wrong"}},
{},