From 6d72c01cf1d57d0d79bdf2f78c7ada0cd3b55d24 Mon Sep 17 00:00:00 2001 From: dontmindaditya Date: Tue, 14 Apr 2026 00:48:32 -0700 Subject: [PATCH] updates --- code_review_graph/parser.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code_review_graph/parser.py b/code_review_graph/parser.py index db0fdae..d0ac094 100644 --- a/code_review_graph/parser.py +++ b/code_review_graph/parser.py @@ -324,9 +324,10 @@ def parse_bytes(self, path: Path, source: bytes) -> tuple[list[NodeInfo], list[E if language == "notebook": return self._parse_notebook(path, source) - # Databricks .py notebook exports - if language == "python" and source.startswith( - b"# Databricks notebook source\n", + # Databricks .py notebook exports (handle both Unix and Windows line endings) + if language == "python" and ( + source.startswith(b"# Databricks notebook source\n") or + source.startswith(b"# Databricks notebook source\r\n") ): return self._parse_databricks_py_notebook(path, source) @@ -715,7 +716,7 @@ def _parse_databricks_py_notebook( self, path: Path, source: bytes, ) -> tuple[list[NodeInfo], list[EdgeInfo]]: """Parse a Databricks .py notebook export.""" - text = source.decode("utf-8", errors="replace") + text = source.decode("utf-8", errors="replace").replace("\r", "") # Strip the header line lines = text.split("\n")