Skip to content

Commit ba16e66

Browse files
committed
Fixed outputs index check
1 parent c1fce7c commit ba16e66

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

jupyter_server_documents/outputs/manager.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,14 @@ def write(self, file_id, cell_id, output, display_id=None):
120120
return placeholder
121121

122122
def write_output(self, file_id, cell_id, output, display_id=None):
123-
print(f"display_id:{display_id} passed into write_output")
124123
self._ensure_path(file_id, cell_id)
125124
last_index = self._last_output_index.get(cell_id, -1)
126125
if display_id:
127126
index = self._output_index_by_display_id.get(display_id)
128-
print(f"Found index: {index} for display_id {display_id}")
129127
if index is None:
130128
index = last_index + 1
131129
self._last_output_index[cell_id] = index
132130
self._output_index_by_display_id[display_id] = index
133-
print(f"Generated new index: {index} for display_id: {display_id}")
134131
else:
135132
index = last_index + 1
136133
self._last_output_index[cell_id] = index

jupyter_server_documents/outputs/output_processor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ async def output_task(self, msg_type, cell_id, content):
107107
self._file_id = file_id
108108

109109
display_id = content.get("transient", {}).get("display_id")
110-
self.log.info(f"display_id: {display_id} found in content")
111110
output_index = self.outputs_manager.get_output_index(display_id) if display_id else None
112111
# Convert from the message spec to the nbformat output structure
113112
if self.use_outputs_service:
@@ -128,7 +127,7 @@ async def output_task(self, msg_type, cell_id, content):
128127
# Write the outputs to the ydoc cell.
129128
_, target_cell = notebook.find_cell(cell_id)
130129
if target_cell is not None and output is not None:
131-
if output_index:
130+
if output_index is not None:
132131
target_cell["outputs"][output_index] = output
133132
else:
134133
target_cell["outputs"].append(output)

src/notebook-factory/notebook-factory.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const DIRTY_CLASS = 'jp-mod-dirty';
3838
}
3939

4040
if (change.outputsChange) {
41-
console.trace(change.outputsChange);
4241
globalModelDBMutex(() => {
4342
let retain = 0;
4443
for (const outputsChange of change.outputsChange!) {

0 commit comments

Comments
 (0)