Skip to content

Commit 9ed3941

Browse files
committed
Eliminate variable value when computing data frame info (#10081)
1 parent c455dc0 commit 9ed3941

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

news/2 Fixes/10075.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix data viewer not opening on certain data frames.

src/client/datascience/jupyter/jupyterVariables.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ export class JupyterVariables implements IJupyterVariables {
9898
return defaultValue;
9999
}
100100

101-
// Prep our targetVariable to send over
102-
const variableString = JSON.stringify(targetVariable).replace(/\\n/g, '\\\\n');
101+
// Prep our targetVariable to send over. Remove the 'value' as it's not necessary for getting df info and can have invalid data in it
102+
const pruned = { ...targetVariable, value: '' };
103+
const variableString = JSON.stringify(pruned);
103104

104105
// Setup a regex
105106
const regexPattern = extraReplacements.length === 0 ? '_VSCode_JupyterTestValue' : ['_VSCode_JupyterTestValue', ...extraReplacements.map(v => v.key)].join('|');

0 commit comments

Comments
 (0)