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

Make packaged Kedro project work in interactive environment #4026

Merged
merged 14 commits into from
Aug 9, 2024

Conversation

merelcht
Copy link
Member

@merelcht merelcht commented Jul 23, 2024

Description

Part of #3237 and #1807

Updated Databricks docs here: #4067

Follow up on #4012

Note

If/when this PR is accepted, I'll update the starters. For the time being there's a PR with only the find_run_command refactoring changes: kedro-org/kedro-starters#230

Development notes

Similar changes have been proposed before, e.g. #2682 and tried in #3191. Note that there was a bit of muddled communication though around what value to set standalone_mode to. In many conversations it says setting standalone_mode to True, but that's the default and for an interactive environment like ipython or Databricks it should be set to False.

How to test

  1. Checkout branch and install branch.
  2. Create a new project (double check it has the modified __main__.py from this PR)
  3. Add some sample pipeline code to run.
  4. kedro package
  5. pip install dist/<package>
  6. ipython
  7. import <package>
  8. from <package>.__main__ import main()
  9. main()
  10. Your project will run without error.

To compare this PR to the current status, follow the above steps with the latest released kedro and you'll see that when running main() inside ipython you'll get an SystemExit: 0.

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

@merelcht merelcht self-assigned this Jul 23, 2024
Base automatically changed from prototype-entrypoint to main August 6, 2024 08:04
@merelcht merelcht marked this pull request as ready for review August 6, 2024 09:43
Copy link
Contributor

@noklam noklam left a comment

Choose a reason for hiding this comment

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

Should we close also this?
#2682

@merelcht
Copy link
Member Author

merelcht commented Aug 6, 2024

Should we close also this? #2682

Yes #2682 can be closed when this PR is merged!

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.

Looks good to me, thank you!

@merelcht merelcht enabled auto-merge (squash) August 9, 2024 08:47
@merelcht merelcht merged commit c409d68 into main Aug 9, 2024
41 checks passed
@merelcht merelcht deleted the make-entrypoint-work-for-interactive-env branch August 9, 2024 09:06
@datajoely
Copy link
Contributor

It's been a long time coming - this is great, great work team

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.

Packaged kedro pipeline does not work well on Databricks
4 participants