-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spike: Enable access to OmegaConfigLoader DictConfig instead of dict only #2973
Comments
Thanks for raising this request @Galileo-Galilei ! I definitely see the value in adding this. We are currently focussing on getting our next breaking release |
Just from the various issues I'm subscribed to - it feels like this is something we need to prioritise |
Moving this back to our Inbox so we can discuss it and prioritise it again. |
Description
As a plugin developer, I have several use cases for which I want to have control over configuration at runtime. With the new
OmegaConfigLoader
, configuration is available incontext.config_loader["catalog"]
, which returns a dictionary with all key already resolved.I'd like to access the "raw" configuration (with interpolated variables not resolved yet) and not the fully resolved ones. I could reload the yaml file, but kedro performs hidden operations to merge environments in
load_and_merge_dir_config
that I don't want to reproduce because it is hard to maintain and error prone.Context
One use case I have is to identify "globals" variables use for the specific pipeline to log them in mlflow (I don't want to log all the "globals.yml" file to avoid polluting my mlflow with globals unrelated to my pipeline). In order to do this, I'd like to check in the "raw" configuration which key will be resolved with the globals resolver
OmegaConf
stores configuration in a special object calledDictConfig
. This object has several helpers methods, particularly to help to traverse the tree structure, to check if a key is interpolated... I'd like to access this object directly to benefits from :load_and_merge_dir_config
Possible Implementation
The
DictConfig
object is propagated all way long inload_and_merge_dir_config
, and it is converted back to a dictionary in the return statement with theto_container
. It is converted on the fly in the__getitem__
method.I think a potential implementation (this a simplified sketch of what it could look like and I don't have all the implications in mind) could look like:
load_dict_config
(name TBD) methods toOmegaConfigLoader
that basically implements the current__getitem__
method without converting config back to a container__getitem__
to only perform the conversion, e.g. something like:Is this something you might consider of interest, or ever already considered ?
The text was updated successfully, but these errors were encountered: