Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message when executing kedro run without pipeline #3794

Open
davidmosca opened this issue Apr 9, 2024 · 10 comments
Open

Improve error message when executing kedro run without pipeline #3794

davidmosca opened this issue Apr 9, 2024 · 10 comments
Labels
Component: CLI Issue/PR that addresses the CLI for Kedro Component: Documentation 📄 Issue/PR for markdown and API documentation good first issue Good first issues for beginners

Comments

@davidmosca
Copy link

davidmosca commented Apr 9, 2024

Description

After having installed Kedro as per the instructions (https://docs.kedro.org/en/stable/get_started/new_project.html#run-the-new-project), I get an error message when I execute kedro run.

Context

This bug prevents me from completing the installation of Kedro.

Steps to Reproduce

activate the kedro environment: conda activate myenv
execute kedro: kedro run

Expected Result

The execution should complete without errors.

Actual Result

The run fails and the the stack trace shows an error message.

(myenv) C:\Users\user1\Documents\GitHub\myproject>kedro run
[04/09/24 15:02:13] INFO     Kedro project myproject                                                      session.py:321Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Scripts\kedro.exe\__main__.py", line 7, in <module>
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\kedro\framework\cli\cli.py", line 198, in main
    cli_collection()
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\click\core.py", line 1157, 
in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\kedro\framework\cli\cli.py", line 127, in main
    super().main(
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\click\core.py", line 1078, 
in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\click\core.py", line 1688, 
in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\click\core.py", line 1434, 
in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\kedro\framework\cli\project.py", line 225, in run
    session.run(
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\kedro\framework\session\session.py", line 346, in run
    filtered_pipeline = pipeline.filter(
                        ^^^^^^^^^^^^^^^^
  File "C:\Users\user1\AppData\Local\anaconda3\envs\myenv\Lib\site-packages\kedro\pipeline\pipeline.py", line 768, in filter
    raise ValueError(
ValueError: Pipeline contains no nodes after applying all provided filters

Your Environment

  • IDE: VSCode
  • Kedro version used (pip show kedro or kedro -V): 0.19.3
  • Python version used (python -V): 3.11.8
  • Operating system and version: Windows 10.0.19045
@noklam
Copy link
Contributor

noklam commented Apr 9, 2024

You need to install the project dependencies to run a project. (which could be pandas, pyspark etc depending what you have selected).

The steps should be

kedro new
cd <project_name>
pip install -r . or pip install -e .
kedro run

If this solve the issue please close the ticket.

@noklam noklam closed this as completed Apr 9, 2024
@noklam noklam reopened this Apr 9, 2024
@noklam
Copy link
Contributor

noklam commented Apr 9, 2024

I see that the docs are confusing, you need to have a pipeline in order to run kedro run.

kedro new --name=testproject --tools=lint,docs,pyspark --example=n mean you are not selecting any example, thus you have no pipeline/nodes and the error, can you change it to --example=y instead?

@noklam noklam added Issue: Bug Report 🐞 Bug that needs to be fixed Component: Documentation 📄 Issue/PR for markdown and API documentation labels Apr 9, 2024
@davidmosca
Copy link
Author

I see. I don't have a pipeline, I was just following the installation instructions in sequence. The docs would benefit from clarifying that a pipeline is needed. Once I have built one, I will try again. In the meantime, you can close the ticket. Thanks.

@astrojuanlu
Copy link
Member

Thanks for opening this issue @davidmosca and sorry you had a bumpy first experience.

I don't think this is only a docs issue: if there are no pipelines defined, kedro run should clearly say so:

> kedro run
No pipelines defined, use `kedro pipeline create` to create one
> echo $status
1

@davidmosca
Copy link
Author

Then I don't know. I just followed the installation instructions sequentially with tools 1,2,4,5,7. kedro info returns the expected message.

@astrojuanlu
Copy link
Member

If anything, there are 2 issues here:

  • The docs literally say "Whichever options you selected for tools and example code [...] Now run the project:", which is not exactly correct: a pipeline needs to be there.

Whichever options you selected for tools and example code, once `kedro new` has completed, the next step is to navigate to the project folder (`cd <project-name>`) and install dependencies with `pip` as follows:
```bash
pip install -r requirements.txt
```
Now run the project:
```bash
kedro run
```

@noklam
Copy link
Contributor

noklam commented Apr 22, 2024

You have selected no project tools

To skip the interactive flow you can run `kedro new` with
kedro new --name=<your-project-name> --tools=<your-project-tools> --example=<yes/no>

Consider adding some warning about an empty project.

@merelcht merelcht changed the title Error when executing kedro run Improve error message when executing kedro run without pipeline May 20, 2024
@merelcht merelcht added good first issue Good first issues for beginners and removed Component: Documentation 📄 Issue/PR for markdown and API documentation labels May 20, 2024
@merelcht merelcht added this to the Improve Developer Experience milestone May 20, 2024
@merelcht merelcht added Component: Documentation 📄 Issue/PR for markdown and API documentation Component: CLI Issue/PR that addresses the CLI for Kedro and removed Issue: Bug Report 🐞 Bug that needs to be fixed labels May 20, 2024
@merelcht merelcht moved this to To Do in Kedro Framework Jun 5, 2024
@doshi-kevin
Copy link

Hey is this issue still open, since I want to work on it

@astrojuanlu
Copy link
Member

Hi @doshi-kevin , go ahead!

@doshi-kevin
Copy link

Hey @astrojuanlu, could you tell me which changes are yet to be applied? Since I see no change in the documentation, I am getting a different error message upon running the command kedro run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CLI Issue/PR that addresses the CLI for Kedro Component: Documentation 📄 Issue/PR for markdown and API documentation good first issue Good first issues for beginners
Projects
Status: To Do
Development

No branches or pull requests

5 participants