kedro-org / kedro-viz

Visualise your Kedro data and machine-learning pipelines and track your experiments.
https://demo.kedro.org
Apache License 2.0
647 stars 106 forks source link

%run_viz Jupyter line magic inconsistency #1823

Open ravi-kumar-pilla opened 3 months ago

ravi-kumar-pilla commented 3 months ago

Description

Tried executing %run_viz line magic on Jupyter notebook to test --inlcude-hooks option, while the command gets passed appropriately, Open Viz link appears even before considering the flag. This shows, we are not terminating the previous session.

This inconsistency was also detected during https://github.com/kedro-org/kedro-viz/pull/1733

Image

The image above is from a debug session using print statements placed at -

  1. run_viz function at kedro_viz/launchers/jupyter.py line 120
  2. checked if viz is up for the second run by placing a print statement at kedro_viz/launchers/jupyter.py line 133
  3. placed a print statement in load_data function at kedro_viz/integrations/kedro/data_loader.py line 99

Context

I am not an expert in using Jupyter notebook but when I execute %run_viz line magic with differing options, each execution box should take in the options before restarting the viz server. Currently, we check if the viz is up and we show the Open Kedro Viz link which has a stale session.

Steps to Reproduce

  1. Setup Kedro Viz and have a Kedro Project
  2. Execute kedro jupyter notebook
  3. Create a notebook and execute %run_viz
  4. It takes some time and gives you a link to open kedro viz
  5. Try executing %run_viz --ignore-hooks or any other option and debug it using print statements
  6. The link to open kedro viz appears instantly, without restarting the server with new arguments

Actual Result

Image

Your Environment

Include as many relevant details as possible about the environment you experienced the bug in:

Checklist