-
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
Let LocalFileLinter
reuse the Dependency
instead falling back on its path
#3586
Conversation
✅ 57/57 passed, 2 skipped, 25m39s total Running from acceptance #8171 |
7447e12
to
c58925d
Compare
problems[idx] = dataclasses.replace(problem, source_path=self._path) | ||
return problems | ||
# supported language that does not generate dependencies | ||
if self.language == Language.SQL: |
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.
Can we combine this and the other return as SQL is also unsupported and probably doesn't need an if statement
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.
I prefer to keep it like this because SQL is supported, it just does not return a dependency graph, see #3639
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.
Commented a few nits. Approving so that you can merge in the AM.
Surpassed by #3641 |
## Changes Use `Language` on `LocalFile`, not `CellLanguage`, as a file might consist of cells when it is a notebook, but the file language is not a cell language ### Linked issues Breaks up #3586 ### Functionality - [x] rewrote code linting related resources ### Tests - [x] Added tests for `LocalFile`
…t from the context (#3638) <!-- REMOVE IRRELEVANT COMMENTS BEFORE CREATING A PULL REQUEST --> ## Changes Make session state public on `LinterContext` and access it from the context instead of passing it along. ### Linked issues Breaks up #3586 ### Functionality - [x] rewrote code linting related resources ### Tests - [x] Reusing existing tests
## Changes Improve file handling by `FileLoader`: - Verify the `FileLoader` resolves files using the `PathLookup` - Handle file opening errors, like `PermissionError`, `FileNotFoundError` - Handle file with BOM encodings - Handle empty files ### Linked issues Breaks up #3586 ### Functionality - [x] rewrote code linting related resources ### Tests - [x] Added tests for `FileLoader`
Changes
Let
LocalFileLinter
reuse theDependency
instead falling back on its path as we introduce duplicate ways of loading files.In addition to that, the PR contains a clean up of:
source_code/linters/files.py
tosource_code/files.py
to avoid circular importsMockPathLookup
to verify which paths are resolvedcurrent_session
public onLinterContext
for reuse instead of passing it next to theLinterContext
FileLoader
Linked issues
Progresses #3514
Breaks up #3520
Functionality
databricks labs ucx migrate-local-code
Tests