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

pipeline.pipeline confuses IDE autocompletion #2805

Open
noklam opened this issue Jul 17, 2023 · 5 comments
Open

pipeline.pipeline confuses IDE autocompletion #2805

noklam opened this issue Jul 17, 2023 · 5 comments

Comments

@noklam
Copy link
Contributor

noklam commented Jul 17, 2023

Description

We import pipeline in our starter and this confuse IDE like VSCode, as it thinks pipeline is a module instead of the pipeline function.

from kedro.pipeline import Pipeline, node, pipeline

Changing it to the following avoid the issue.

from kedro.pipeline.modular_pipeline import pipeline
image

The problem here is IDE confuse kedro.pipeline.modular_pipeline as kedro.pipeline.pipeline module.

Context

Solution 1:

  • Move the pipeline definition (Or what's the difference between pipeline and modular pipeline? Will be a breaking change if we move modules)

Solution 2:

  • Change starter to import from modular_pipeline explicitly, should we keep the shortcut in this case?

Solution 3:

  • find out ways that won't confuse IDE (VS Code in my case, user report this with PyCharm too)

Expected Result

Actual Result

-- If you received an error, place it here.
-- Separate them if you have more than one.

Your Environment

  • Kedro version used (pip show kedro or kedro -V):
  • Python version used (python -V):
  • Operating system and version:
@astrojuanlu
Copy link
Member

or

from kedro import Pipeline

Pipeline.make(...)

😄 #712

(see also #2723 about "modular pipelines" vs just "pipelines")

@noklam
Copy link
Contributor Author

noklam commented Sep 4, 2023

Added 0.19 tag to prompt for discussion in case we need to move stuff around. (It's annoying Github project change doesn't allow comment🥲)

@noklam
Copy link
Contributor Author

noklam commented Sep 25, 2023

Discussed in backlog grooming. Will keep this as a low priority for the 0.19 release and see if we have time to fit this in.

If we end up don't want to break anything in 0.19, we should still update the starters to avoid these syntax highlight problem by importing from kedro.pipeline.modular_pipeline directly.

@astrojuanlu
Copy link
Member

astrojuanlu commented Sep 25, 2023

There's more confusion: kedro-org/kedro-viz#1522 (comment)

Some users are creating the pipelines with the Pipeline class.

I think we should tackle this and #2723 at once.

@astrojuanlu
Copy link
Member

I just saw this code snippet in someone else's code:

my_pipeline = Pipeline([
    Node(filter_func, "df_input", "df_filtered"),
    Node(actual_func, "df_filtered", "df_output"),
])

is there a reason why we are using the pipeline and node helpers instead of the Pipeline and Node class initializers directly?

@merelcht merelcht added this to the Improve Developer Experience milestone Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants