vscode-jupyter icon indicating copy to clipboard operation
vscode-jupyter copied to clipboard

Variable explorer outdated after kernel restart

Open pwang347 opened this issue 2 years ago • 0 comments

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]

  1. 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")
  1. Execute the first cell
  2. Restart the kernel
  3. Immediately execute the second cell
  4. Observe that the new variables do not appear, and the old one is still visible image

(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 (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

XXX

pwang347 avatar Feb 14 '24 19:02 pwang347