Skip to content

Commit a4836c7

Browse files
fix(parsing): loading params.yaml even when not required
1 parent 36cad4b commit a4836c7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dvc/parsing/context.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,11 +510,17 @@ def _load_params_from_dict(self, fs, item: dict, wdir: str):
510510
):
511511
continue
512512

513+
# Skip if keys is None - this means the params are only for dependency
514+
# tracking, not for ${param.*} interpolation. The keys will be resolved
515+
# from other loaded param files (global params or params.yaml).
516+
if keys is None:
517+
continue
518+
513519
path = fs.normpath(fs.join(wdir, file_path))
514520
if not fs.exists(path):
515521
raise ParamsLoadError(f"'{path}' does not exist")
516522

517-
# If keys is empty list, load all params
523+
# If keys is empty list, load all params from the file
518524
key_list = keys if keys else None
519525
data = read_param_file(fs, path, key_paths=key_list, flatten=False)
520526
self._merge_params_data(data, path)

0 commit comments

Comments
 (0)