microsoft / vscode-data-wrangler

Other
439 stars 20 forks source link

Could not retrieve variable df from the Jupyter extension. #321

Closed davidSkrob closed 3 weeks ago

davidSkrob commented 4 weeks ago

Environment data

Expected behaviour

show variable snapshot in data viewer

Actual behaviour

Error: "Could not retrieve variable df from the Jupyter extension. Please file an issue on the Data Wrangler GitHub repository."

Steps to reproduce:

N/A

Logs

pwang347 commented 4 weeks ago

Hi @davidSkrob, thanks for opening this issue! Could you please share some more information about the variable you are trying to launch? (e.g., data type, sample code to reproduce the issue). Thanks!

davidSkrob commented 4 weeks ago

I don't think the problem will be in code, but here you go:

the python code

import pandas as pd

with open("01.dat", "r") as f:
    df = pd.read_csv(f, delimiter=",")

df.head()

01.dat

T,R,U
0,100.5,-0.0005
99.424,138.7,4.32
232,187.4,11.06

The error code I got was when I went to Jupyter terminal. I don't even see the button under the cell to open data wrangler

pwang347 commented 3 weeks ago

@davidSkrob got it, yes that is strange - the code snippet and data you sent seems to load fine for me. Are you able to load any variables at all, or is this issue only affecting you sometimes?

To help me investigate further, could you please try reproducing the issue again while the developer console is open? (ie., run the following command and switch to the Console tab, then trigger the issue) Image

You can open the command palette with ctrl+shift+P.

A screenshot of relevant issues would be helpful, or you can also save the full logs and share it like this (by clicking "Save as"): Image

Thanks!

davidSkrob commented 3 weeks ago

Hi, it happens every time I try to open data wrangler. Here is the log vscode-app-1730066652141.log

pwang347 commented 3 weeks ago

Hi @davidSkrob! Thanks for the response. Could you please also expand the error message before saving or send a screenshot of the error object expanded? The error message will not show up in the logs if the console window was not open when the error appeared: Image

With error message: Image

Image

Thanks!

davidSkrob commented 3 weeks ago

Oh, sorry @pwang347, here is the expanded console log vscode-app-1730098834387.log

davidSkrob commented 3 weeks ago

and here is the screenshot Image

pwang347 commented 3 weeks ago

Hi @davidSkrob, I think I was able to reproduce the same error that you see (which is just an empty object {}). Could you please double check your kernel access permissions here, opened with Ctrl+Shift+P and then typing Jupyter: Manage Access to Jupyter Kernels? Image

Please make sure that Data Wrangler is checked here and press "ok": Image

Note that in our next release, this error message should be more clear to the user when they do not have permissions. Let me know if this resolves the issue for you!

davidSkrob commented 3 weeks ago

Thanks Paul, this resolved the issue =)