Skip to content

Commit 29743d9

Browse files
authored
Delete stale code: NotebookLinter._load_source_from_run_cell (#3529)
## Changes Delete stale code: `NotebookLinter._load_source_from_run_cell` ### Linked issues Progresses #3514 ### Functionality - [x] modified code linting related - [x] modified existing command: `databricks labs ucx lint-local-code` ### Tests - [x] manually tested - [x] added and modified unit tests
1 parent a874f15 commit 29743d9

File tree

1 file changed

+0
-22
lines changed
  • src/databricks/labs/ucx/source_code/notebooks

1 file changed

+0
-22
lines changed

src/databricks/labs/ucx/source_code/notebooks/sources.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -307,28 +307,6 @@ def _linter(self, language: Language) -> Linter:
307307
return self._python_linter
308308
return self._context.linter(language)
309309

310-
def _load_source_from_run_cell(self, run_cell: RunCell) -> None:
311-
path = run_cell.maybe_notebook_path()
312-
if path is None:
313-
return # malformed run cell already reported
314-
resolved = self._path_lookup.resolve(path)
315-
if resolved is None:
316-
return # already reported during dependency building
317-
language = file_language(resolved)
318-
if language is not Language.PYTHON:
319-
return
320-
source = safe_read_text(resolved)
321-
if not source:
322-
return
323-
notebook = Notebook.parse(path, source, language)
324-
for cell in notebook.cells:
325-
if isinstance(cell, RunCell):
326-
self._load_source_from_run_cell(cell)
327-
continue
328-
if not isinstance(cell, PythonCell):
329-
continue
330-
self._python_linter.process_child_cell(cell.original_code)
331-
332310
@staticmethod
333311
def name() -> str:
334312
return "notebook-linter"

0 commit comments

Comments
 (0)