Skip to content

Commit

Permalink
Update default_element.py
Browse files Browse the repository at this point in the history
Force deep copy when package overrides are used
  • Loading branch information
andywag authored Jan 8, 2025
1 parent ca4d25c commit b1c88e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hydra/core/default_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ def __post_init__(self) -> None:
raise ValueError("_self_@PACKAGE is not supported")
if self.package == "_here_":
self.package = ""
if self.package is not None:
# Deep copy is required to avoid mutating the original config so this mode is turned off if this condition is found
OmegaConf.default_flags["no_deepcopy_set_nodes"] = False

def is_self(self) -> bool:
return self.path == "_self_"
Expand Down

0 comments on commit b1c88e9

Please sign in to comment.