Simplify the kedro new
validation logic
#3284
Labels
Issue: Feature Request
New feature or improvement to existing feature
kedro new
validation logic
#3284
Description
Currently, there are multiple ways to validate the inputs
_validate_config_file_inputs
(also regex based)_parse_add_ons_input
They are only used for path of the flow. There are 4 different way to create a project
a.
kedro new
- interactive promptb.
kedro new --addon
c.
kedro new --config
- take a YAML file(d).
kedro new --starter
, for exampleprompts.yml
share theregex_validator
for addon and starters.You can find more details of the flow below.
The problem here is:
_validate_config_file_inputs
is almost exactly the same asprompts.yml
, which is only used for (c).regex
is not flexible, because in some case it is much easier to validate after parsing. i.e. how do you write a regex for1,2,3,4,5 | none | all | 1-5
? It is much easier if you parse it first - then we can check if the selection exist or notIn addition, we should also move the logic out to a
addon.py
, it will be more obvious which logic are shared between "starter" and "addon", right now they are blurred in a singlestarter.py
.Extra explanation
Note: this isn't really pressing at the moment, if we end up expanding the scope of this work we may prioritise this.
Context
Possible Implementation
Possible Alternatives
The text was updated successfully, but these errors were encountered: