-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: open data viewer from debug variables view #131
Comments
Hi @connor4312, it would be great to have this integrated for Data Wrangler. I wanted to check with you: is the runtime environment exposed for the debugging context or do visualizers only have access to the serialized values? Data Wrangler works primarily with Pandas DataFrame objects so if it is the latter we would at least need a full representation (e.g. pickled format) to be able to parse it properly. Not too sure if that would be feasible yet for perf reasons. Of course, we would ideally like access to the full runtime environment (ie. a REPL where we can run Python code) but from what I'm seeing that doesn't seem to be available. Thanks! |
You can see more of a description here microsoft/vscode#197287 (comment)
|
Got it, thanks for the details. I will need to play around with it some more, but tentatively it seems like we can evaluate arbitrary expressions with |
related: #49 |
After looking into this area more, I don't think the new proposed API is required and you should be able to just contribute to the debug context menu:
Where The new API is more targeted towards extensions that want to provide a way to display the variable value within the variable view itself. |
Is there a chance we can implement this feature? Right now, many people are using DataViewer in debug mode from the Jupyter Extension, but it just said that this feature is deprecated in favour of Data Wrangler. |
Hi @gkocjan, note that it is possible already to use Data Wrangler while debugging in both the stable and pre-release versions (any of the following entrypoints should work): However, specifically for this button in the debug panel ![]() ... it's something that still needs to be hooked up. You can track the progress on it here: microsoft/vscode-jupyter#15680 Thanks! |
Hello @pwang347 . Standard Python ScriptWhen executing a standard Python Script (.py), this option is not available. I get: There is only this option: And no other variables inspector. Using interactive PythonWhen using interactive Python interpreter, there is the option: Here is the action when clicking the "Show variable snapshot in data view": What is missingWhat is missing is the ability to use the Data Wrangler when debugging a Python Script, while using the standard compiler. Code used:# %%
import pandas as pd
# Creating a dictionary with sample data
data = {
'Name': ['John', 'Anna', 'Peter', 'Linda', 'Mark'],
'Age': [25, 30, 35, 28, 40],
'City': ['New York', 'Paris', 'London', 'Tokyo', 'Sydney'],
'Salary': [50000, 60000, 70000, 55000, 65000]
}
# Creating DataFrame
df = pd.DataFrame(data)
# %%
print(df)
# %% |
Hi @juanbretti, thank you for sharing more about your use case! Just to confirm, I found that the "View Value in Data Viewer" button only appears if you have the Jupyter extension installed but it isn't present otherwise (e.g. if you disable the Jupyter extension). Let me know if my steps below are the same as yours: If having the Jupyter extension installed is not a problem for you, then this issue should address your ask: microsoft/vscode-jupyter#15680 Otherwise, if you want to support this functionality for pure Python without any IPython dependency it would be good to open a new GitHub issue and continue the discussion there. Thanks! |
@pwang347 , thank you for your prompt response.
When I debug using: I do see: But this option, opens: Which is not the "Data Wrangler" variable inspector. Does it work the same way for you too? |
Hi @juanbretti, yes that is the way it works for me as well. I meant to say that the viewer you see is coming from the Jupyter extension currently, so there is technically a dependency on IPython (to my understanding). If that is not an issue to you, the missing functionality you described should be resolved soon from the Jupyter side. Hope this helps! Edit: to clarify, this will also require a change in the DW extension. I will let you know when both changes are available. |
can't wait to use this feature!!! |
#131 (comment) TLDR: it would be great to use Data Wrangler from a pure Python script debugging window because it gives many more features |
Hi all! Support for the debug variables entrypoint (for both .py and .ipynb files) is now released in VS Code Insiders. You can give it a try with the following extension versions:
Note that this feature will also be available in the Stable version around early June. Thanks again for using Data Wrangler and for contributing to the discussion! |
@pwang347 I didn't find the entry for a pure .py in pre-release 1.1.2, did I missed sth? like configuration etc... Maybe I should switch my vsocde from stable to insider? |
Yes, as mentioned before by @pwang347 , you need to try Visual Studio Code Insiders. |
Hi @7Eric9! Yes, that is correct. If you would like to try out the experience now, you will need to use VS Code Insiders (see link shared by @juanbretti). For a bit of explanation, this is because the Jupyter prerelease version needed above (v2024.5.2024052401) depends on the latest VS Code Insiders version, which is not yet available in VS Code Stable (but will be in about a week). |
Hello @pwang347, do you know when this feature will be available in VS Code Stable? You mentioned that it should be in early June, but I haven't seen it in the last version |
Hi @edumoros! It is working for me on the following latest stable versions:
Could you please double-check if the same configuration above works for you? |
Hi @pwang347! I have those same versions, but it's not working for me. |
@edumoros That's odd, could you please double check that the Data Wrangler extension is not disabled? For example, by checking the extension page here: ![]() If Data Wrangler is not disabled, I would recommend opening an issue here: https://github.com/microsoft/vscode-jupyter/issues Since the Data Viewer is being routed by the Jupyter extension and you should not see the old one if you have Data Wrangler installed. Another thing that might be worth checking is whether you are able to open the Data Wrangler viewer from debugging a |
i am using the same versions here, but it's very unstable. VS Code Stable: 1.91.0 |
@Huanyu-Liu Hi! The launch delegation is currently happening on the Jupyter extension side, could you please open an issue in the Jupyter extension repository? It would be great if you can provide short example code to reproduce the issue. Thanks! |
There is a new proposed API that would enable the data wrangler extension to contribute its data visualizer for specific variables listed in the debug variables view: https://github.com/microsoft/vscode/blob/b62def4ceb2fe7c0a31908e98e76586d4a191285/src/vscode-dts/vscode.proposed.debugVisualization.d.ts#L1
With a sample implementation here:
https://github.com/microsoft/vscode-extension-samples/tree/connor4312/debug-viz-demo/proposed-api-sample
If that API wouldn't work for some reason, I'm sure @connor4312 would be happy to have your feedback.
The text was updated successfully, but these errors were encountered: