-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove tree from PythonSequentialLinter
#3535
base: main
Are you sure you want to change the base?
Conversation
60bcf2e
to
1e7a4b9
Compare
882bbbf
to
b7998bc
Compare
@@ -244,7 +244,10 @@ def test_functional(sample: Functional, mock_path_lookup, simple_dependency_reso | |||
("_child_that_uses_missing_value.py", "parent_that_dbutils_runs_child_that_misses_value_from_parent.py"), | |||
("_child_that_uses_value_from_parent.py", "grand_parent_that_dbutils_runs_parent_that_magic_runs_child.py"), | |||
("_child_that_uses_missing_value.py", "parent_that_imports_child_that_misses_value_from_parent.py"), | |||
("_child_that_uses_value_from_parent.py", "grand_parent_that_imports_parent_that_magic_runs_child.py"), | |||
# TODO: Confirm to delete this test as it is a file that imports a notebook that runs the child, which is not a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look at the motivation for deleting this test:
Confirm to delete this test as it is a file that imports a notebook that runs the child, which is not possible in a real world scenario and it results in the imported notebook to be treated as a file as the
ImportResolver
only returns containers for files not for notebooks (as it should) which causes side effects like a different context inheritance
❌ 49/56 passed, 7 failed, 2 skipped, 26m18s total ❌ test_workflow_linter_lints_job_with_import_pypi_library: AttributeError: 'Tree' object has no attribute 'attach_nodes' (32.155s)
❌ test_lint_local_code: AttributeError: 'Tree' object has no attribute 'attach_nodes' (32.999s)
❌ test_workflow_linter_lints_job_with_dbfs_egg_dependency: AttributeError: 'Tree' object has no attribute 'attach_nodes' (1m16.396s)
❌ test_workflow_linter_lints_job_with_workspace_egg_dependency: AttributeError: 'Tree' object has no attribute 'attach_nodes' (1m17.892s)
❌ test_job_task_linter_library_installed_cluster: AttributeError: 'Tree' object has no attribute 'attach_nodes' (1m25.089s)
❌ test_job_spark_python_task_workspace_linter_happy_path: AttributeError: 'Tree' object has no attribute 'attach_nodes' (21.728s)
❌ test_job_dlt_task_linter_happy_path: AttributeError: 'Tree' object has no attribute 'attach_nodes' (24.051s)
Running from acceptance #8030 |
Changes
Remove tree from
PythonSequentialLinter
as the sequential linter should just sequence linting, not be used as an intermediate for manipulating the code tree.PythonSequentialLinter
NotebookLinter
to do the (notebook) tree manipulation instead:_load_tree_from_notebook
early return onFailure
similarly to dependency graph building: if we cannot resolve the code used by a notebook then fail early%run
notebook trees a child tree to the cell that calls the notebookLinked issues
Resolves #3543
Progresses #3514
Stacked on #3524
Requires #3529
Functionality
databricks labs ucx lint-local-code
Tests