Galen Seilis
07/23/2025, 10:03 PMLaura Couto
07/23/2025, 10:58 PMparameters.yml file? If that's the case, yes, what you're getting when you call the params argument in a node function is a copy, not a reference.
If you look at the way the config loader class fetches the parameters from the .yaml files in the conf directory in your project, you can see that they are loaded into a python dictionary that'll belong to that one instance of the config loader that's created when you run your pipeline. So they cannot alter the ones that you have in the configuration files.
Also, any parameters you pass at runtime via the CLI, for example, with kedro run --params='{"key": "value"}', will override the parameters defined in the .yaml files for that run. But those overrides will only apply during the execution and do not persist back to your files.Nok Lam Chan
07/24/2025, 12:00 PMMemoryDataset for any undeclared dataset, and by default params: are loaded as MemoryDataset. In memory dataset, you can control how it is copy via a copy_mode
def _infer_copy_mode(data: Any) -> str:
# Skip ...
if pd and isinstance(data, pd.DataFrame) or np and isinstance(data, np.ndarray):
copy_mode = "copy"
elif type(data).__name__ == "DataFrame" or ibis and isinstance(data, ibis.Table):
copy_mode = "assign"
else:
copy_mode = "deepcopy"
return copy_mode
So by default it uses deepcopy, this guarantee you cannot mutate the parameters inside parameters. If the question is about dataset, then it depends on what copy_mode. For parameters, I don't think there is a way to modify copy_mode from user code.Galen Seilis
07/25/2025, 5:10 PM