From 3845034bda475ccc3aeba58043be5e10957cf4e1 Mon Sep 17 00:00:00 2001 From: Andrew Snare Date: Mon, 3 Jun 2024 16:37:42 +0200 Subject: [PATCH 1/2] Remove unnecessary linting suppression. --- src/databricks/labs/ucx/source_code/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/databricks/labs/ucx/source_code/jobs.py b/src/databricks/labs/ucx/source_code/jobs.py index 6cadff9e90..6edd518465 100644 --- a/src/databricks/labs/ucx/source_code/jobs.py +++ b/src/databricks/labs/ucx/source_code/jobs.py @@ -131,7 +131,7 @@ def _register_notebook(self, graph: DependencyGraph) -> Iterable[DependencyProbl path = WorkspacePath(self._ws, notebook_path) return graph.register_notebook(path) - def _register_spark_python_task(self, graph: DependencyGraph): # pylint: disable=unused-argument + def _register_spark_python_task(self, graph: DependencyGraph): if not self._task.spark_python_task: return [] notebook_path = self._task.spark_python_task.python_file From 331b959162cd3d623d5754af6735fd9eac9acea0 Mon Sep 17 00:00:00 2001 From: Andrew Snare Date: Mon, 3 Jun 2024 16:38:01 +0200 Subject: [PATCH 2/2] Don't flag DataFrameWriter.insertInto() for potential format incompatibility. The .insertInto() operation uses the format of the existing table; the format option (if provided) is ignored. --- src/databricks/labs/ucx/source_code/linters/table_creation.py | 1 - tests/unit/source_code/linters/test_table_creation.py | 1 - 2 files changed, 2 deletions(-) diff --git a/src/databricks/labs/ucx/source_code/linters/table_creation.py b/src/databricks/labs/ucx/source_code/linters/table_creation.py index 37f45b4513..b339f6bedc 100644 --- a/src/databricks/labs/ucx/source_code/linters/table_creation.py +++ b/src/databricks/labs/ucx/source_code/linters/table_creation.py @@ -107,7 +107,6 @@ def __init__(self, dbr_version: tuple[int, int] | None): [ NoFormatPythonMatcher("writeTo", 1, 1), NoFormatPythonMatcher("table", 1, 1), - NoFormatPythonMatcher("insertInto", 1, 2), NoFormatPythonMatcher("saveAsTable", 1, 4, 2, "format"), ] ) diff --git a/tests/unit/source_code/linters/test_table_creation.py b/tests/unit/source_code/linters/test_table_creation.py index 66fca48a21..34ee80558d 100644 --- a/tests/unit/source_code/linters/test_table_creation.py +++ b/tests/unit/source_code/linters/test_table_creation.py @@ -9,7 +9,6 @@ METHOD_NAMES = [ "writeTo", "table", - "insertInto", "saveAsTable", ] ASSIGN = [True, False]