This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
[Configuration Management] Allow config in config or config in code. #3807
Labels
Issue: Feature Request
New feature or improvement to existing feature
Description
Was just thinking that it would be great to let users pick between config in code vs config in yaml. What I mean by this is:
It's not too many lines of code changed (I monkeypatched a few files just to check), but would also add another dimension of flexibility on how to use kedro. Giving option back to users to decide how they would like to manage their configuration.
Context
Right now I cannot use dataclasses to manage my configuration, which is a reasonable pattern to want to use. I've seen preferences of fully leveraging IDE, vs the mindset that there is clear separation between parameters vs code. I believe kedro should offer this type of flexibility to end users while still prescribing a preferred default.
Possible Implementation
I did monkeypatch a few files and got a small prototype working awhile back. Basically where kedro does a
catalog.load
for the string. For starters, we can allow the following:Changes can be made here:
kedro/kedro/runner/runner.py
Line 494 in 44817b8
Note the last elif basically means anything goes through, so I can define any object in any function used by a node and it cleanly gets passed through. Limiting to dataclasses also seems incomplete.
To make it flexible you could move this mapping of
object
toload_func
tosettings.py
so users can always handle this themselves instead of puttingif..elif
in the kedro codebase.Possible Alternatives
N/A
The text was updated successfully, but these errors were encountered: