vscode-jupyter
vscode-jupyter copied to clipboard
Variable explorer outdated after kernel restart
Environment data
- VS Code version: 1.87.0-insider
- Jupyter Extension version (available under the Extensions sidebar): v2024.2.2024021201 (pre-release)
- Python Extension version (available under the Extensions sidebar): v2024.0.1
- OS (Windows | Mac | Linux distro) and version: Mac
- Python and/or Anaconda version: 3.11.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Jupyter server running: Local
Expected behaviour
Old variables are cleared from the variable explorer after kernel restarts
Actual behaviour
Old variables are persisted
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- Create a notebook with two cells
Cell 1
foo = "bar"
Cell 2
import pandas as pd
df_titanic = pd.read_csv("https://raw.githubusercontent.com/pwang347/cdn/master/titanic.csv")
df_housing_500k = pd.read_csv("https://raw.githubusercontent.com/pwang347/cdn/master/AB_NYC_2019_500k.csv")
df_stack_overflow = pd.read_csv("https://raw.githubusercontent.com/pwang347/cdn/master/survey_results_public.csv")
- Execute the first cell
- Restart the kernel
- Immediately execute the second cell
- Observe that the new variables do not appear, and the old one is still visible
(note that this can cause problems when trying to use the data viewer since the variable no longer exists in kernel memory)
Logs
Output for Jupyter in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Jupyter)
XXX