Skip to content

Commit 00f21cc

Browse files
committed
Fixed linting issue.
1 parent 996b782 commit 00f21cc

File tree

1 file changed

+11
-1
lines changed
  • src/databricks/labs/ucx/source_code/linters

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from collections.abc import Iterable
55
from datetime import datetime, timezone
6+
from functools import partial
67
from pathlib import Path
78

89
from databricks.labs.blueprint.parallel import Threads
@@ -59,8 +60,17 @@ def refresh_report(
5960
self, sql_backend: SqlBackend, inventory_database: str, /, last_run_days: int | None = None
6061
) -> None:
6162
tasks = []
63+
64+
def lint_job_limited(job_id: int) -> tuple[list[JobProblem], list[DirectFsAccess], list[UsedTable]]:
65+
return self.lint_job(job_id, last_run_days=last_run_days)
66+
6267
for job in self._jobs_crawler.snapshot():
63-
tasks.append(lambda: self.lint_job(job.job_id, last_run_days=last_run_days))
68+
try:
69+
job_id = int(job.job_id)
70+
except ValueError:
71+
logger.warning(f"Invalid job id: {job.job_id}")
72+
continue
73+
tasks.append(partial(lint_job_limited, job_id))
6474
# TODO: Limit Scope
6575
logger.info(f"Running {len(tasks)} linting tasks in parallel...")
6676
job_results, errors = Threads.gather('linting workflows', tasks)

0 commit comments

Comments
 (0)