diff --git a/news/2 Fixes/10075.md b/news/2 Fixes/10075.md new file mode 100644 index 000000000000..1b4d7f29dbbf --- /dev/null +++ b/news/2 Fixes/10075.md @@ -0,0 +1 @@ +Fix data viewer not opening on certain data frames. \ No newline at end of file diff --git a/src/client/datascience/jupyter/jupyterVariables.ts b/src/client/datascience/jupyter/jupyterVariables.ts index 057e88c83bbc..ce3b925e8747 100644 --- a/src/client/datascience/jupyter/jupyterVariables.ts +++ b/src/client/datascience/jupyter/jupyterVariables.ts @@ -120,8 +120,9 @@ export class JupyterVariables implements IJupyterVariables { return defaultValue; } - // Prep our targetVariable to send over - const variableString = JSON.stringify(targetVariable).replace(/\\n/g, '\\\\n'); + // 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 + const pruned = { ...targetVariable, value: '' }; + const variableString = JSON.stringify(pruned); // Setup a regex const regexPattern =