support partially overwrite keys in nested dict
@@ -68,6 +68,10 @@ def apply_overwrites_to_context(context, overwrite_context):
"{} provided for choice variable {}, but the "
"choices are {}.".format(overwrite, variable, context_value)
)
+ if isinstance(context_value, dict) and isinstance(overwrite, dict):
+ # Partially overwrite some keys in original dict
+ apply_overwrites_to_context(context_value, overwrite)
+ context[variable] = context_value
else:
# Simply overwrite the value for this variable
context[variable] = overwrite
