From 941440aa4a5815e8d8157d167ec581524a1f6e20 Mon Sep 17 00:00:00 2001 From: Merel Theisen <49397448+merelcht@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:45:42 +0000 Subject: [PATCH] Add clarifications about load_node usability with IPython and add comment around requirements (#3648) Signed-off-by: Merel Theisen --- docs/source/development/debugging.md | 2 +- docs/source/notebooks_and_ipython/kedro_and_notebooks.md | 9 +++++++-- kedro/ipython/__init__.py | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/source/development/debugging.md b/docs/source/development/debugging.md index 87cd4ff743..f55a75bf00 100644 --- a/docs/source/development/debugging.md +++ b/docs/source/development/debugging.md @@ -4,7 +4,7 @@ Our debugging documentation has moved. Please see our existing guides: ``` -* [Debugging a Kedro project within a notebook](../notebooks_and_ipython/kedro_and_notebooks.md#debugging-a-kedro-project-within-a-notebook) for information on how to debug using the `%load_node` line magic and an interactive debugger. +* [Debugging a Kedro project within a notebook or IPython shell](../notebooks_and_ipython/kedro_and_notebooks.md#debugging-a-kedro-project-within-a-notebook) for information on how to debug using the `%load_node` line magic and an interactive debugger. * [Debugging in VSCode](./set_up_vscode.md#debugging) for information on how to set up VSCode's built-in debugger. * [Debugging in PyCharm](./set_up_pycharm.md#debugging) for information on using PyCharm's debugging tool. * [Debugging in the CLI with Kedro Hooks](../hooks/common_use_cases.md#use-hooks-to-debug-your-pipeline) for information on how to automatically launch an interactive debugger in the CLI when an error occurs in your pipeline run. diff --git a/docs/source/notebooks_and_ipython/kedro_and_notebooks.md b/docs/source/notebooks_and_ipython/kedro_and_notebooks.md index 76769f69cd..2fdc4ec339 100644 --- a/docs/source/notebooks_and_ipython/kedro_and_notebooks.md +++ b/docs/source/notebooks_and_ipython/kedro_and_notebooks.md @@ -224,7 +224,7 @@ For more details, run `%reload_kedro?`. ### `%load_node` line magic ``` {note} -This is still an experimental feature and is currently only available for Jupyter Notebook (>7.0) and Jupyter Lab. If you encounter unexpected behaviour or would like to suggest feature enhancements, add it under [this github issue](https://github.com/kedro-org/kedro/issues/3580). +This is still an experimental feature and is currently only available for Jupyter Notebook (>7.0), Jupyter Lab, IPython, and VSCode Notebook. If you encounter unexpected behaviour or would like to suggest feature enhancements, add it under [this github issue](https://github.com/kedro-org/kedro/issues/3580). ``` You can load the contents of a node in your project into a series of cells using the `%load_node` line magic. @@ -242,12 +242,17 @@ Ensure you use the name of your node as defined in the pipeline, not the name of ---- To be able to access your node's inputs, make sure they are explicitly defined in your project's catalog. You can then run the generated cells to recreate how the node would run in your pipeline. You can use this to explore your node's inputs, behaviour, and outputs in isolation, or for [debugging](#debugging-a-kedro-project-within-a-notebook). +When using this feature in Jupyter Notebook you will need to have the following requirements and minimum versions installed: +```yaml +ipylab>=1.0.0 +notebook>=7.0.0 +``` + ### `%run_viz` line magic ``` {note} diff --git a/kedro/ipython/__init__.py b/kedro/ipython/__init__.py index 8011de346f..2a6b2d66d3 100644 --- a/kedro/ipython/__init__.py +++ b/kedro/ipython/__init__.py @@ -217,7 +217,7 @@ def _guess_run_environment() -> str: # pragma: no cover ) def magic_load_node(args: str) -> None: """The line magic %load_node . - Currently, this feature is only available for Jupyter Notebook (>7.0), Jupyter Lab + Currently, this feature is only available for Jupyter Notebook (>7.0), Jupyter Lab, IPython, and VSCode Notebook. This line magic will generate code in multiple cells to load datasets from `DataCatalog`, import relevant functions and modules, node function definition and a function call. If generating code is not possible, it will print @@ -270,7 +270,7 @@ def _load_node(node_name: str, pipelines: _ProjectPipelines) -> list[str]: notebook cell. """ warnings.warn( - "This is an experimental feature, only Jupyter Notebook (>7.0) & Jupyter Lab " + "This is an experimental feature, only Jupyter Notebook (>7.0), Jupyter Lab, IPython, and VSCode Notebook " "are supported. If you encounter unexpected behaviour or would like to suggest " "feature enhancements, add it under this github issue https://github.com/kedro-org/kedro/issues/3580" )