diff --git a/dvc/parsing/__init__.py b/dvc/parsing/__init__.py index f12bcd7e6..216ebf907 100644 --- a/dvc/parsing/__init__.py +++ b/dvc/parsing/__init__.py @@ -136,14 +136,14 @@ class DataResolver: except ContextError as exc: format_and_raise(exc, "'vars'", self.relpath) - # we wrap the definitions into ForeachDefinition and EntryDefinition, - # that helps us to optimize, cache and selectively load each one of - # them as we need, and simplify all of this DSL/parsing logic. # we use `tracked_vars` to keep a dictionary of used variables # by the interpolated entries. self.tracked_vars: Dict[str, Mapping] = {} stages_data = d.get(STAGES_KWD, {}) + # we wrap the definitions into ForeachDefinition and EntryDefinition, + # that helps us to optimize, cache and selectively load each one of + # them as we need, and simplify all of this DSL/parsing logic. self.definitions: Dict[str, Definition] = { name: make_definition(self, name, definition) for name, definition in stages_data.items() diff --git a/dvc/parsing/context.py b/dvc/parsing/context.py index 67e34d4c1..a9abbf566 100644 --- a/dvc/parsing/context.py +++ b/dvc/parsing/context.py @@ -335,9 +335,9 @@ class Context(CtxDict): Defaults to False. Note that the default is different from `resolve`. """ - key = normalize_key(key) + normalized = normalize_key(key) try: - node = super().select(key) + node = super().select(normalized) except ValueError as exc: raise KeyNotInContext(key) from exc