hey, found something poking at `kedro new`. if you...
# questions
r
hey, found something poking at
kedro new
. if you name a project after a stdlib module (tried
email
and
json
), it scaffolds fine but
kedro run
then dies with
ModuleNotFoundError: No module named 'email.pipeline_registry'
because the package name collides with stdlib. settings.py also gets silently ignored (No settings.py found even though its right there). attached a couple screenshots: one shows the ModuleNotFound even though pipeline_registry.py was created and exists, vs a normally named project (
controltest
) which gets past that line and just gives the expected no nodes ValueError. Parameters passed all tools, no example pipelines looks like the name validation in starters.py only checks the character set, not python keywords or stdlib names, so its specifically the collision. worth a github issue? happy to put up a fix adding a keyword/stdlib check if youd take it 🙂
K 1
do let me know if this is too much of an adversarial input, i was trying to see how robust kedro is
l
Hi Rudra, this is an interesting case. Feel free to open an issue.
r
my pleasure ! have also closed in on a fix, will be opening a pr also shortly, thx for the confirmation.
opened a PR for this: https://github.com/kedro-org/kedro/pull/5608 validates the derived package name against keyword.iskeyword() and sys.stdlib_module_names at creation time, so names like email/json get rejected with a clear message instead of producing a broken project. tests + RELEASE.md included, DCO signed. lmk if youd want any changes
👍 1
r
Thank you for the contribution @Rudra Dudhat.
❤️ 1