Open ghylander opened 2 years ago
This is the "source" for a regular notebook cell:
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"execution": {
"iopub.execute_input": "2021-07-05T10:42:52.838788Z",
"iopub.status.busy": "2021-07-05T10:42:52.838238Z",
"iopub.status.idle": "2021-07-05T10:42:55.231015Z",
"shell.execute_reply": "2021-07-05T10:42:55.231372Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Test1\n",
"Test2\n"
]
}
],
"source": [
"[...]"
]
},
And this is the same cell after the notebook is executed through papermill:
{
"cell_type": "code",
"execution_count": 16,
"id": "38fa880c",
"metadata": {
"execution": {
"iopub.execute_input": "2022-10-10T12:47:06.086042Z",
"iopub.status.busy": "2022-10-10T12:47:06.085877Z",
"iopub.status.idle": "2022-10-10T12:47:07.302541Z",
"shell.execute_reply": "2022-10-10T12:47:07.302091Z"
},
"papermill": {
"duration": 1.226089,
"end_time": "2022-10-10T12:47:07.303689",
"exception": false,
"start_time": "2022-10-10T12:47:06.077600",
"status": "completed"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Test1\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Test2\n"
]
}
],
"source": [
"[...]
}
There's 2 main differences (at least in this case):
"papermill": {
"duration": 1.226089,
"end_time": "2022-10-10T12:47:07.303689",
"exception": false,
"start_time": "2022-10-10T12:47:06.077600",
"status": "completed"
}
The output is divided into sub-elements:
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Test1\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Test2\n"
]
}
],
@ghylander do you have the notebook document open all the time when this happened? Does it still happen when you close the same notebook and open again?
Hi,
Yes, this happens if when I start VSC I don't have the notebook open, then open it. I can open the notebook, as long as I don't scroll down to a cell with output
I think I may have found a cause. When rendering a regular notebook in VSC, the output of cells is trimmed to the size limit, with an option to open the full output in a text editor
This does not happen with the papermill notebooks, the full output of the cell is shown. I think this might be caused because in papermill, the 'output' element is subdivided into individual output elements, instead of grouping all output in a single element (therefore, VSC instead of trimming one single large output, detects that each output is small in size and does not trim them individually).
The output of some of the cells in the notebook is very large (hundreds of lines of text per cell). As they are divided by element instead of grouped together, every single sub-element is rendered. Perhaps VSC is freezing when trying to render the full output of hundreds of lines inside the notebook
If this turns out to be what's happening, I can't tell if it would be something fixable from the jupyter extension or directly on VSC side
That makes it sound like what I was experiencing when running the repro example for https://github.com/microsoft/vscode/issues/141022 - vscode just becomes unresponsive. I think there is some limit for how many outputs we will display, but maybe that's just for images. either way, a configureable limit for output items to display would help here, aside from looking into what specifically goes wrong when it's overloaded like that. (it doesn't look like typical memory pressure)
Environment data
Description
VSC is instantly freezing when opening scrolling down to a papermill notebook cell with output Even before the the cell is actually shown (i assume it's pre-rendering it)
When this happens, the system slows down significantly
I tried downgrading the pylance extension to version 2022.4.3 (as I saw in other issues) but it had no effect
Perhaps may be caused by notebooks executed by papermill (https://github.com/nteract/papermill)?
Logs