kedro icon indicating copy to clipboard operation
kedro copied to clipboard

Kedro new starter CLI : user_input.lower()

Open Ipsedo opened this issue 2 months ago • 5 comments

Description

I use kedro starter CLI configured by prompt.yml with regex check and I think I found one issue : the user inputs are systematically transformed to lowercase : https://github.com/kedro-org/kedro/blob/main/kedro/framework/cli/starters.py#L957 The result is that I can't restrict user input to uppercase or lowercase

Context

I want to restrict user input to uppercase

Steps to Reproduce

  1. create a cookiecutter template for kedro (regarding your need)
  2. create your cookiecutter.json with project_name as unique prompt
  3. create your prompt.yml with an entry for project_name
  4. set the regex_validator field to "[A-Z_]+"
  5. start kedro new --starter=./my_starter and answer MY_PROJECT for project_name prompt
  6. It will fail due to the user_input.lower() in kedro/framework/cli/starters.py line 957

Expected Result

The regex and the input must match

Actual Result

The user input is refused

Your Environment

Python : 3.9.13 Kedro : 0.19.3 OS : Linux (distribution and kernel version confidential)

Ipsedo avatar Apr 05 '24 09:04 Ipsedo