Skip to content
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

'Failed to fetch variable info from the Jupyter Server' for variables containing items of pd.PeriodIndex type #14626

Closed
1 of 2 tasks
VijayAT123 opened this issue Oct 31, 2023 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug variable-explorer

Comments

@VijayAT123
Copy link

VijayAT123 commented Oct 31, 2023

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Variable explorer can't open pandas PeriodIndex type variables in a new tab.

wageemp['Quarter'] = wageemp['YearQuarter'].str.replace(r'(\d{4})(\d)', r'\1-Q\2', regex=True)
wageemp['Quarter'] = pd.PeriodIndex(wageemp['Quarter'], freq='q')

So far, I've only seen this behavior on variables that have PeriodIndex types. Before typecasting Quarter, the DataFrame was able to be opened in a new tab.

VS Code Version

1.83.1

Jupyter Extension Version

v2023.9.1102792234

Jupyter logs

10:25:54.539 [info] Loading webview. View is notset
10:25:54.539 [info] Loading web view...
10:25:54.540 [info] Webview panel created.
10:25:54.690 [info] Web view react rendered
10:25:55.237 [info] Process Execution: ~/miniconda3/envs/dew/bin/python -c "import pandas;print(pandas.__version__)"
10:25:55.779 [error] [Error: Failed to fetch variable info from the Jupyter Server.
	at Zy.extractJupyterResultText (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:151357)
	at Zy.deserializeJupyterResult (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:151442)
	at Zy.getDataFrameRows (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:149555)
	at async Nx.getRows (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:614382)
	at async ~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:601394
	at async bx.wrapRequest (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:601671)]
10:25:55.779 [warn] DataScience Error [Error: Failed to fetch variable info from the Jupyter Server.
	at Zy.extractJupyterResultText (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:151357)
	at Zy.deserializeJupyterResult (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:151442)
	at Zy.getDataFrameRows (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:149555)
	at async Nx.getRows (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:614382)
	at async ~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:601394
	at async bx.wrapRequest (~/.vscode/extensions/ms-toolsai.jupyter-2023.9.1102792234-darwin-arm64/out/extension.node.js:24:601671)]

Coding Language and Runtime Version

Python v3.11.4, Pandas 2.0.3

Language Extension Version (if applicable)

Python ms-python.python Version: 2023.18.0

Anaconda Version (if applicable)

Miniconda3 23.7.4

Running Jupyter locally or remotely?

Local

@VijayAT123 VijayAT123 added the bug Issue identified by VS Code Team member as probable bug label Oct 31, 2023
@roblourens roblourens assigned amunger and unassigned roblourens Nov 1, 2023
@seflue
Copy link

seflue commented Dec 10, 2023

I observe the same issue with geopandas GeoDataFrames converted into pandas DataFrames:

Jupyter logs

14:14:58.891 [info] Process Execution: <path-to-my-personal-environment>\python.exe -c "import pandas;print(pandas.__version__)"
14:14:59.866 [error] [Error: Failed to fetch variable info from the Jupyter Server.
	at Uy.extractJupyterResultText (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:265:76)
	at Uy.deserializeJupyterResult (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:265:158)
	at Uy.getDataFrameRows (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:264:34835)
	at async Mu.getRows (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:351:60607)
	at async ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:351:48459
	at async jf.wrapRequest (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:351:48735)]
14:14:59.866 [warn] DataScience Error [Error: Failed to fetch variable info from the Jupyter Server.
	at Uy.extractJupyterResultText (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:265:76)
	at Uy.deserializeJupyterResult (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:265:158)
	at Uy.getDataFrameRows (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:264:34835)
	at async Mu.getRows (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:351:60607)
	at async ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:351:48459
	at async jf.wrapRequest (~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\dist\extension.node.js:351:48735)]

@christopherball
Copy link

Same error when attempting to inspect a super basic dataframe variable from the Polars 'Getting Started' docs.

image

10:46:37.387 [info] Process Execution: ~/Documents/Github/polarsStarterTemplate/.venv/bin/python -c "import pandas;print(pandas.__version__)"
10:46:37.706 [error] [Error: Failed to fetch variable info from the Jupyter Server.
	at Uy.extractJupyterResultText (~/.vscode/extensions/ms-toolsai.jupyter-2023.11.1003402403-darwin-arm64/dist/extension.node.js:265:76)
	at Uy.deserializeJupyterResult (~/.vscode/extensions/ms-toolsai.jupyter-2023.11.1003402403-darwin-arm64/dist/extension.node.js:265:158)
	at Uy.getDataFrameInfo (~/.vscode/extensions/ms-toolsai.jupyter-2023.11.1003402403-darwin-arm64/dist/extension.node.js:264:34382)
	at async Mu.ensureInitialized (~/.vscode/extensions/ms-toolsai.jupyter-2023.11.1003402403-darwin-arm64/dist/extension.node.js:351:61001)
	at async Mu.getDataFrameInfo (~/.vscode/extensions/ms-toolsai.jupyter-2023.11.1003402403-darwin-arm64/dist/extension.node.js:351:59826)
	at async jf.prepDataFrameInfo (~/.vscode/extensions/ms-toolsai.jupyter-2023.11.1003402403-darwin-arm64/dist/extension.node.js:351:47621)
	at async jf.showData (~/.vscode/extensions/ms-toolsai.jupyter-2023.11.1003402403-darwin-arm64/dist/extension.node.js:351:45751)]

@spg-iwilson
Copy link

Same as christopherball. Running Python 3.12.3, Visual Studio Code 1.89.1

@amunger
Copy link
Contributor

amunger commented Jun 3, 2024

Try out the Data Wrangler extension, it has a data viewer that can handle this data type, and the data viewer in the jupyter extension is being deprecated

@amunger amunger closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@spg-iwilson
Copy link

Thanks, worked for me. I did have to pip install pyarrow. Perhaps that was the issue with the data viewer in the jupyter extension

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug variable-explorer
Projects
None yet
Development

No branches or pull requests

6 participants