Hi All: What is the difference between `kedro run`...
# questions
a
Hi All: What is the difference between
kedro run
and
metadata = bootstrap_project(Path.cwd())
with KedroSession.create(metadata.package_name) as session:
session.run()
kedro run
can succeed but the second way can’t
n
Good question! We are about to add more docs. What errors did you get? Kedro need to work from the project root directory, so your path.cwd need to be where the pyproject.toml is Exceptions are the Kedro Jupyter command, where we try to search the root directory for users and that’s the magic behind the “%reload_magic”
a
Hi @Nok Lam Chan
n
And Kedro run would work? This is weird the error you shown is not related to Kedro it seems to be your node logic?
Could you share the run.py ? Which command did you run to execute this file and from which directory
a
python run.py
It doesn’t work
but
python cli.py
It works
n
Could it be running from different Python environment? From your run.py you are using lots of protected method which shouldn’t be needed, you may want to remove that. It’s unclear what’s wrong here since session.run seems working fine since the error you are got is about your data
a
This is where it gets weird 😂 In addition to the fact that run.py and cli.py are different, Everything else is the same
hi @Nok Lam Chan
this problem is solved add
if __name__ == '__main__'
before
session.run()
fix it
1