-
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
Support inferred values when linting sys path - saved #1863
Conversation
elif isinstance(base_node, ImportSource): | ||
yield from self._register_import(base_node) | ||
else: | ||
logger.error(f"Can't process {NodeBase.__name__} of type {type(base_node).__name__}") |
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.
logger.error(f"Can't process {NodeBase.__name__} of type {type(base_node).__name__}") | |
logger.warning(f"Can't process {NodeBase.__name__} of type {type(base_node).__name__}") |
Error logs fail the workflow
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.
done
|
||
def _visit_inferred(self, changed: NodeNG, inferred: NodeNG, is_relative: bool, is_append: bool): | ||
if inferred is Uninferable or not isinstance(inferred, Const): | ||
self.sys_path_changes.append(UnresolvedPath(changed, changed.as_string(), is_append)) |
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.
self.sys_path_changes.append(UnresolvedPath(changed, changed.as_string(), is_append)) | |
self.sys_path_changes.append(UnresolvedPath(changed, changed.as_string(), is_append)) | |
return |
Can we explicitly return, so that branches won't fall through accidentally?
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.
done
Changes
Infer value of sys.path.xxx() calls and raise advice if unresolved
Linked issues
Progresses #1205
Functionality
databricks labs ucx ...
...
...
Tests