Skip to content

Commit dbb6b9c

Browse files
authored
Fix solacc failure (#3077)
## Changes Our nightly solacc CI job has been failing for a while. This PR aims to fix that ### Linked issues None ### Functionality None ### Tests - [x] manually tested: ran solacc CI job --------- Co-authored-by: Eric Vergnaud <eric.vergnaud@databricks.com>
1 parent 1e53812 commit dbb6b9c

File tree

2 files changed

+7
-2
lines changed
  • src/databricks/labs/ucx/source_code/linters
  • tests/integration/source_code

2 files changed

+7
-2
lines changed

src/databricks/labs/ucx/source_code/linters/files.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations # for type hints
22

3+
import dataclasses
34
import logging
45
from collections.abc import Iterable, Callable
56
from pathlib import Path
@@ -50,7 +51,11 @@ def build_dependency_graph(self, parent: DependencyGraph) -> list[DependencyProb
5051
if self._language is CellLanguage.PYTHON:
5152
context = parent.new_dependency_graph_context()
5253
analyzer = PythonCodeAnalyzer(context, self._original_code)
53-
return analyzer.build_graph()
54+
problems = analyzer.build_graph()
55+
for idx, problem in enumerate(problems):
56+
if problem.is_path_missing():
57+
problems[idx] = dataclasses.replace(problem, source_path=self._path)
58+
return problems
5459
# supported language that does not generate dependencies
5560
if self._language is CellLanguage.SQL:
5661
return []

tests/integration/source_code/solacc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def _lint_dir(solacc: _SolaccContext, soldir: Path):
215215

216216

217217
def _lint_repos(clone_urls, sol_to_lint: str | None):
218-
solacc = _SolaccContext.create(sol_to_lint is not None)
218+
solacc = _SolaccContext.create(for_all_dirs=sol_to_lint is None)
219219
if sol_to_lint:
220220
sol_dir = _clone_repo(clone_urls[sol_to_lint], sol_to_lint)
221221
_lint_dir(solacc, sol_dir)

0 commit comments

Comments
 (0)