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

Add support for %load_ext kedro #4406

Merged
merged 14 commits into from
Jan 15, 2025
Merged

Add support for %load_ext kedro #4406

merged 14 commits into from
Jan 15, 2025

Conversation

ravi-kumar-pilla
Copy link
Contributor

@ravi-kumar-pilla ravi-kumar-pilla commented Jan 8, 2025

Description

Resolves #4063

Development notes

  • Added load_ipython_extension function in kedro/__init__.py to make kedro available as ipython ext
  • Relaxed importlinter to ignore missing contracts
  • Added pytest

QA notes

  • Install kedro (pip install git+https://github.com/kedro-org/kedro@feat/load_ext)
  • Run ipython in the terminal
  • Run %load_ext kedro to check if kedro is available as ipython extension. kedro should be recognized as ipython extension and it should load other magic methods like (%reload_kedro, %load_node)

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

Signed-off-by: ravi_kumar_pilla <[email protected]>
Signed-off-by: ravi_kumar_pilla <[email protected]>
Signed-off-by: ravi_kumar_pilla <[email protected]>
@ravi-kumar-pilla ravi-kumar-pilla changed the title Feat/load ext Enable kedro as ipython extension Jan 8, 2025
@ravi-kumar-pilla ravi-kumar-pilla marked this pull request as ready for review January 9, 2025 19:50
@ravi-kumar-pilla ravi-kumar-pilla changed the title Enable kedro as ipython extension Add support for %load_ext kedro Jan 9, 2025
@ravi-kumar-pilla ravi-kumar-pilla requested review from noklam, DimedS and ElenaKhaustova and removed request for merelcht January 9, 2025 19:56
@merelcht merelcht mentioned this pull request Jan 13, 2025
5 tasks
Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

The code looks good. Can you provide some steps on how to test it manually?

kedro/__init__.py Outdated Show resolved Hide resolved
Copy link
Member

@astrojuanlu astrojuanlu left a comment

Choose a reason for hiding this comment

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

I confirm it works!

$ uv run ipython
... 
In [1]: %load_ext kedro
[01/14/25 15:47:45] INFO     Using '/Users/juan_cano/Projects/QuantumBlackLabs/Kedro/kedro/kedro/framework/project/rich_logging.yml' as logging configuration.                __init__.py:270
                    INFO     Registered line magic '%reload_kedro'                                                                                                             __init__.py:61
                    INFO     Registered line magic '%load_node'                                                                                                                __init__.py:63

Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

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

Tested it and it works well 👍

@ravi-kumar-pilla ravi-kumar-pilla merged commit 1ed504c into main Jan 15, 2025
42 checks passed
@ravi-kumar-pilla ravi-kumar-pilla deleted the feat/load_ext branch January 15, 2025 15:37
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.

Support %load_ext kedro
4 participants