Skip to content

Commit 4a860a1

Browse files
committed
Merge branch 'main' into typing
2 parents d94c263 + a892a6b commit 4a860a1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
exclude: ^\.yarn
1818

1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.8.6
20+
rev: v0.9.2
2121
hooks:
2222
- id: ruff
2323
args: [--fix, --show-fixes]

jupyter_ydoc/ynotebook.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ def get(self) -> dict:
251251
cells = []
252252
for i in range(len(self._ycells)):
253253
cell = self.get_cell(i)
254-
if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
254+
if (
255+
"id" in cell
256+
and int(meta.get("nbformat", 0)) == 4
257+
and int(meta.get("nbformat_minor", 0)) <= 4
258+
):
255259
# strip cell IDs if we have notebook format 4.0-4.4
256260
del cell["id"]
257261
if (

0 commit comments

Comments
 (0)