Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/5420.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix error with bad len() values in variable explorer
10 changes: 8 additions & 2 deletions pythonFiles/datascience/getJupyterVariableValue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@

# Find shape and count if available
if (hasattr(_VSCODE_evalResult, 'shape')):
_VSCODE_targetVariable['shape'] = str(_VSCODE_evalResult.shape)
try:
_VSCODE_targetVariable['shape'] = str(_VSCODE_evalResult.shape)
except TypeError:
pass

if (hasattr(_VSCODE_evalResult, '__len__')):
_VSCODE_targetVariable['count'] = len(_VSCODE_evalResult)
try:
_VSCODE_targetVariable['count'] = len(_VSCODE_evalResult)
except TypeError:
pass

# Get the string of the eval result, truncate it as it could be far too long
_VSCODE_targetValue = str(_VSCODE_evalResult)
Expand Down