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 messages for modular pipelines #3716

Merged
merged 8 commits into from
Mar 18, 2024

Conversation

AhdraMeraliQB
Copy link
Contributor

@AhdraMeraliQB AhdraMeraliQB commented Mar 14, 2024

Description

Closes #2633

Our ModularPipelineErrors have not been the most informative or clear to understand. This PR updates two of them in an effort to improve clarity.

  1. When creating a pipeline using the pipeline() function, if the provided inputs/outputs/parameters do not match up with those of the nodes provided, the following error message, with relevant suggestions, will now be raised:
ModularPipelineError: Failed to map these inputs onto the nodes provided: model_input_table - did you mean one of these instead: model_input_table_NOT_FOUND
  1. The error message ModularPipelineError: Inputs should be free inputs to the pipeline has been updated to the more clear ModularPipelineError: Inputs must not be outputs from another node in the same pipeline

  2. The error message ModularPipelineError: Outputs can't contain free inputs to the pipeline has been updated to the more clear ModularPipelineError: All outputs must be generated by some node within the pipeline

Development notes

Developer Certificate of Origin

We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a Signed-off-by line in the commit message. See our wiki for guidance.

If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.

Checklist

  • Read the contributing guidelines
  • Signed off each commit with a Developer Certificate of Origin (DCO)
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes
  • Checked if this change will affect Kedro-Viz, and if so, communicated that with the Viz team

Ahdra Merali added 3 commits March 14, 2024 15:25
Signed-off-by: Ahdra Merali <ahdra.merali@quantumblack.com>
Signed-off-by: Ahdra Merali <ahdra.merali@quantumblack.com>
Signed-off-by: Ahdra Merali <ahdra.merali@quantumblack.com>
@AhdraMeraliQB AhdraMeraliQB marked this pull request as ready for review March 14, 2024 17:02
Copy link
Contributor

@datajoely datajoely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! This is massively helpful and one the points we raised in #3094. I have some wording suggestions, but I think this is a really useful update.

kedro/pipeline/modular_pipeline.py Outdated Show resolved Hide resolved
kedro/pipeline/modular_pipeline.py Outdated Show resolved Hide resolved
@ElenaKhaustova ElenaKhaustova self-requested a review March 15, 2024 10:09
Copy link
Contributor

@ElenaKhaustova ElenaKhaustova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on my side, LGTM!

Left a suggestion on adjusting the message in case of non_existent > 1 and approving the PR. 🚀

Ahdra Merali added 2 commits March 18, 2024 07:25
Signed-off-by: Ahdra Merali <ahdra.merali@quantumblack.com>
Signed-off-by: Ahdra Merali <ahdra.merali@quantumblack.com>
Copy link
Contributor

@DimedS DimedS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @AhdraMeraliQB ! This greatly improves clarity and usability!

@AhdraMeraliQB AhdraMeraliQB enabled auto-merge (squash) March 18, 2024 17:05
@AhdraMeraliQB AhdraMeraliQB merged commit 06cf288 into main Mar 18, 2024
34 checks passed
@AhdraMeraliQB AhdraMeraliQB deleted the fix/imporve-modular-pipeline-errors branch March 18, 2024 17:33
@astrojuanlu
Copy link
Member

Tested this locally ⭐ thanks @AhdraMeraliQB and reviewers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error messages for modular pipelines
5 participants