mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 15:28:26 +01:00
fix plots nested configuration
This commit is contained in:
committed by
Dave Berenbaum
parent
5be23cfd4e
commit
212928a1fa
@@ -448,7 +448,12 @@ def _resolve_definitions(
|
||||
config_path = os.fspath(config_path)
|
||||
config_dir = fs.dirname(config_path)
|
||||
result: dict[str, dict] = {}
|
||||
for plot_id, plot_props in definitions.items():
|
||||
|
||||
# sort by key length to process the most general paths first
|
||||
# then override them with more specific ones.
|
||||
for plot_id, plot_props in sorted(
|
||||
definitions.items(), key=lambda item: len(item[0])
|
||||
):
|
||||
if plot_props is None:
|
||||
plot_props = {}
|
||||
if _id_is_path(plot_props):
|
||||
@@ -519,7 +524,7 @@ def unpack_if_dir(fs, path, props: dict[str, str], onerror: Optional[Callable] =
|
||||
|
||||
if "data" in unpacked:
|
||||
for subpath in unpacked["data"]:
|
||||
result["data"].update({subpath: props})
|
||||
result["data"].update({subpath: {} | props}) # avoid shared reference
|
||||
else:
|
||||
result.update(unpacked)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user