Skip to content

Commit 697715e

Browse files
authored
Fix missing nbformat version (#304)
* Fix missing nbformat version * Convert format version to int
1 parent 2b8e788 commit 697715e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jupyter_ydoc/ynotebook.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ def get(self) -> Dict:
202202
cells = []
203203
for i in range(len(self._ycells)):
204204
cell = self.get_cell(i)
205-
if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
205+
if (
206+
"id" in cell
207+
and int(meta.get("nbformat", 0)) == 4
208+
and int(meta.get("nbformat_minor", 0)) <= 4
209+
):
206210
# strip cell IDs if we have notebook format 4.0-4.4
207211
del cell["id"]
208212
if (

0 commit comments

Comments
 (0)