Open mekanavsharma opened 2 weeks ago
Hi @mekanavsharma, thank you for opening this issue! Could you please confirm the following:
Are you able to see the Open 'df' in Data Wrangler
button and launch from the variable panel with the following simple DataFrame?
df = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]})
df
Could you try to reproduce the issue again with the developer console open and check to see if there are any related error messages? You can open the developer console as follows:
It would be very helpful if you could provide the information above. Thanks!
Hi @mekanavsharma, thank you for opening this issue! Could you please confirm the following:
- Are you able to see the
Open 'df' in Data Wrangler
button and launch from the variable panel with the following simple DataFrame?df = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]}) df
- Could you try to reproduce the issue again with the developer console open and check to see if there are any related error messages? You can open the developer console as follows:
It would be very helpful if you could provide the information above. Thanks!
Thanks for the help.
Point 1: No I am not able to see, Open 'df' in Data Wrangler
Point 2: Here is what I got when I reproduced the issue again with the developer console open.
On clicking "console.ts.137" I got:
On Clicking "notificationsAlerts.ts.42" I got:
Hi @mekanavsharma, thanks for the quick response! Some more followups:
Do you want to grant Kernel access to the extension Data Wrangler?
(then reproduce the issue and copy output from the output panel)
Hi @mekanavsharma, thanks for the quick response! Some more followups:
- Do you see a modal popup from Jupyter asking something like this?
Do you want to grant Kernel access to the extension Data Wrangler?
- Do you by any chance have this setting enabled (and if so, could you try the steps in the link?) Data Wrangler attempts to reinstall python and Jupyter ext when I already have them #129 (comment)
- If the above does not resolve the issue for you, I would recommend creating an issue on the Jupyter extension repository and attach Jupyter logs:
(then reproduce the issue and copy output from the output panel)
Thanks for the response :
Here is what I did :
Still I am not getting "Open 'df' in Data Wrangler" . But there is change when I am clicking on popup in Jupyter -Variables. Earlier I was getting the error "Could not retrieve ......" which I have shared the screeshot. This time I am getting a pop-up: Which would re-direct me to Data wrangler which is already installed.
FYI: I used to get this popup a month ago. But then I don't what changes were made and I am not getting this pop.
@mekanavsharma, got it thanks for giving it a try - actually your original settings are correct, the affinity setting is what has caused some problems previously. Please remove that setting for now.
This error message you posted below seems to be the culprit:
Data Wrangler needs permission from the Jupyter extension to access the kernel and it seems to not have permission in this case, but it's strange that you're also not getting a popup. It would be great if you could open an issue on the Jupyter side, as this seems to be related to their kernel API.
@mekanavsharma, got it thanks for giving it a try - actually your original settings are correct, the affinity setting is what has caused some problems previously. Please remove that setting for now.
This error message you posted below seems to be the culprit:
Data Wrangler needs permission from the Jupyter extension to access the kernel and it seems to not have permission in this case, but it's strange that you're also not getting a popup. It would be great if you could open an issue on the Jupyter side, as this seems to be related to their kernel API.
Thanks for the help. Will do that.
To solve this problem, I unchecked this settings
To solve this problem, I unchecked this settings
It worked. Thanks
To solve this problem, I unchecked this settings
Worked for me as well, thank you!! :)
Solution
Jupyter: Manage Access to Jupyter kernels
from the command paletteData Wrangler
extensionAlso ensure the setting Experiments: Use Jupyter Proposed API
is enabled.
The reason this may not have worked in the past is users may have received a prompt requesting Data Wrangler
extension to gain access to Kernels. Its very likely this prompt was dismissed, meaning access was not granted.
The error message logged here is evidence of that https://github.com/microsoft/vscode-data-wrangler/issues/270#issuecomment-2316779172
Thanks all!
Please follow the solution shared by @DonJayamanne as it will soon become the default option moving forward (and you may run into this issue again). It seems like we can also handle this error better on our side to ask for permissions, so I will leave this issue open until that gets checked in.
I have tried the the recommended steps and It's still not working.
I have a pandas dataframe, and i'm right-clicking, then selecting 'View Value in Data Viewer' and I get a small pop up error (attached).
My settings are exactly as described by Don Jayamanne (here).
Hi @dark-tonebone, could you please check to see if you have the same error message in the developer console? You can run the following command to open it
And then make sure you are on the "Console" tab
Do you also have this message or is it something different?
If you are attempting to open a PySpark DataFrame and you see this error, then you may need to follow instructions here: https://github.com/microsoft/vscode-data-wrangler/issues/255#issuecomment-2330415787 (if not, it would be great if you could share what data type you are using!)
Please can you share a screenshot of the following screen Select the command Jupyter: Manage Access to Jupyter kernels from the command palette
I also tried the the recommended steps and It's still not working.
Please could you enable logging as follows:
Jupyter->Logging
trace
Jupyter
output panel (use the command Jupyter: Show Output
to get to the logs).@ZWX013 Could you please also expand the highlighted objects by clicking on the arrow?
After you expand it (and any other relevant errors above), it would be great if you could share the following log file
Thanks!
Hi @DonJayamanne thanks for your response!
DataWrangler worked a bunch for me today, and then I encountered a dataframe it would not load. Here are the requested screenshots taken right after clicking 'View Value in DataViewer' (which failed to open my df in DataWrangler).
Expanded variable in my variable inspector
Jupyter Logs
@pwang347 sorry I'm not sure where in VSCode I can find that arrow to expand... It looks like you're in a web browser dev tools panel? I'm using VSCode on Windows 11.
Interestingly, after closing and reopening VSCode, the DataWrangler now works with that exact same dataframe!
Hi @dark-tonebone! If you are able to view DataFrames sometimes, I think this is a different issue. The permissions issue would prevent you from viewing completely.
In case you are able to reproduce the issue again, could you please try the steps here? You should be able to also see the dev tools panel within VS Code: https://github.com/microsoft/vscode-data-wrangler/issues/270#issuecomment-2334998717
Alternatively, you can try opening it this way:
Hi @pwang347 thanks for the updated instructions to access the dev tools :)
I managed to make it error again. It happened soon after i closed a DataWrangler window that was stale from an old debug session. I closed it while some code was running.
Anyways, here are the screenshots and files you requested in your previous comment: 1) Screenshot of 'Console' tab immediately after error
2) Screenshot of expanded error line
3) Screenshot of the notificationAlerts.ts file
4) .log file obtained by right-clicking the error and saving as vscode-app-1725926313871.log
Hi @dark-tonebone, no problem and thank you for sharing the logs! Looks like you're running into this issue https://github.com/microsoft/vscode-data-wrangler/issues/275
We should have a fix soon this week, but if you'd like a workaround build for now it's available here: https://github.com/microsoft/vscode-data-wrangler/issues/275#issuecomment-2336852687
Awesome! Great to hear there's a fix incoming. I'm happy to wait for the update. Thanks for your prompt responses on this issue, it's very much appreciated 💯
@dark-tonebone small update, the fix for https://github.com/microsoft/vscode-data-wrangler/issues/275 should be available now in pre-release 1.9.2. Please feel free to give it a try and let me know if you're still running into any issues!
@pwang347
Hello,
Have been following this thread and trying the suggestions. I have been unable to view the data viewer regardless of suggestion. After the recent pre-release this still holds true. Gave same information as dark-tonebone as best I can.
Here are my existing settings relevant to this thread:
Console tab has a lot of information - here is the screenshot of the bottom portion
Screenshot of the notificationsAlerts
.log file vscode-app-1725999265621.log
Thank you for your time - please let me know if there's any additional information needed!
Hi @WulfNovak, thanks for sharing. Based on the logs it looks like you're encountering something different, could you please open a new issue to help us with tracking?
In the new issue, I'd like you to share the following info:
Does this happen for any data viewing? E.g. can you try creating a new Python file with just the following code and try to open the variable l
?:
l = [1,2,3]
print(l) # <- add breakpoint here
Could you please share the output of running this code in the same environment where you are getting the error:
def __DW_GET_EXPRESSION_VARIABLE__():
import builtins
import json
import sys
supported_dataframe_types = {
builtins.list: "list",
builtins.dict: "dictionary",
}
if 'numpy' in sys.modules:
try:
import numpy as np
supported_dataframe_types[np.ndarray] = "ndarray"
except builtins.Exception:
pass
if 'pandas' in sys.modules:
try:
import pandas as pd
supported_dataframe_types[pd.DataFrame] = "pandas"
supported_dataframe_types[pd.Series] = "series"
except builtins.Exception:
pass
if 'polars' in sys.modules:
try:
import polars as pl
supported_dataframe_types[pl.DataFrame] = "polars"
supported_dataframe_types[pl.Series] = "polarsSeries"
except builtins.Exception:
pass
if 'xarray' in sys.modules:
try:
import xarray as xr
supported_dataframe_types[xr.DataArray] = "dataArray"
except builtins.Exception:
pass
if 'tensorflow' in sys.modules:
try:
import tensorflow as tf
supported_dataframe_types[tf.Tensor] = "eagerTensor"
except builtins.Exception:
pass
if 'torch' in sys.modules:
try:
import torch
supported_dataframe_types[torch.Tensor] = "tensor"
except builtins.Exception:
pass
if 'pyspark' in sys.modules and False:
try:
import pyspark
supported_dataframe_types[pyspark.sql.dataframe.DataFrame] = "pyspark"
except builtins.Exception:
pass
eval_result = data_viewer_check
if builtins.type(eval_result) not in supported_dataframe_types:
return None
return builtins.print(json.dumps({
"type": supported_dataframe_types[builtins.type(eval_result)],
"supportedEngines": ["pandas"],
}))
try: DW_GET_EXPRESSION_VARIABLE() finally: del DW_GET_EXPRESSION_VARIABLE
Thanks!
Environment data
Expected behaviour
Showed be able to view dataframe in new pop-up
Actual behaviour
When attempting to view a DataFrame in Visual Studio Code using the Data Wrangler extension, I encounter the following error: "Could not retrieve variable autos from the Jupyter extension. Please file an issue on the Data Wrangler GitHub repository."
Steps to reproduce:
I've verified that the DataFrame exists and is accessible in my code. The issue persists after restarting VS Code and updating all relevant extensions. I can view the DataFrame using alternative methods (e.g., print statements, Jupyter notebooks), but not through the Data Wrangler extension.
These are the issues.
Also, I am not able to see Open 'df' in Data Wrangler in my dataframe