-
Notifications
You must be signed in to change notification settings - Fork 17.4k
chore(ci): bump pylint to 2.10.2 #16463
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -381,7 +381,7 @@ def put( # pylint: disable=arguments-differ | |
| try: | ||
| new_model = UpdateAnnotationCommand(g.user, annotation_id, item).run() | ||
| return self.response(200, id=new_model.id, result=item) | ||
| except (AnnotationNotFoundError, AnnotationLayerNotFoundError) as ex: | ||
| except (AnnotationNotFoundError, AnnotationLayerNotFoundError): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm always happy to see Pylint is continuing to evolve it's logic.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was actually really surprised this wasn't caught by older versions |
||
| return self.response_404() | ||
| except AnnotationInvalidError as ex: | ||
| return self.response_422(message=ex.normalized_messages()) | ||
|
|
@@ -438,7 +438,7 @@ def delete( # pylint: disable=arguments-differ | |
| try: | ||
| DeleteAnnotationCommand(g.user, annotation_id).run() | ||
| return self.response(200, message="OK") | ||
| except AnnotationNotFoundError as ex: | ||
| except AnnotationNotFoundError: | ||
| return self.response_404() | ||
| except AnnotationDeleteFailedError as ex: | ||
| logger.error( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,7 @@ def run(self) -> Model: | |
| return annotation | ||
|
|
||
| def validate(self) -> None: | ||
| exceptions: List[ValidationError] = list() | ||
| exceptions: List[ValidationError] = [] | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, this made me chuckle. I don't remember which linter and when, but didn't some linter up until fairly recently complain about using |
||
| layer_id: Optional[int] = self._properties.get("layer") | ||
| start_dttm: Optional[datetime] = self._properties.get("start_dttm") | ||
| end_dttm: Optional[datetime] = self._properties.get("end_dttm") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,7 +68,7 @@ def load_chart_data_into_cache( | |
| raise exc | ||
| except Exception as exc: | ||
| # TODO: QueryContext should support SIP-40 style errors | ||
| error = exc.message if hasattr(exc, "message") else str(exc) # type: ignore # pylint: disable=no-member | ||
| error = exc.message if hasattr(exc, "message") else str(exc) # type: ignore | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @villebro as a side note I might do a pass to remain |
||
| errors = [{"message": error}] | ||
| async_query_manager.update_job( | ||
| job_metadata, async_query_manager.STATUS_ERROR, errors=errors | ||
|
|
@@ -122,11 +122,9 @@ def load_explore_json_into_cache( # pylint: disable=too-many-locals | |
| raise ex | ||
| except Exception as exc: | ||
| if isinstance(exc, SupersetVizException): | ||
| errors = exc.errors # pylint: disable=no-member | ||
| errors = exc.errors | ||
| else: | ||
| error = ( | ||
| exc.message if hasattr(exc, "message") else str(exc) # type: ignore # pylint: disable=no-member | ||
| ) | ||
| error = exc.message if hasattr(exc, "message") else str(exc) # type: ignore | ||
| errors = [error] | ||
|
|
||
| async_query_manager.update_job( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 don't necessarily agree with this rule. While we could add
encoding="utf-8"to all text file opens, this would likely break compatibility with Windows which defaults tocp-1252(not officially supported, but I know some parties in the community are running Superset on Windows). Also, addingencoding=locale.getpreferredencoding()feels pointless. So I recommend we disable this rule for now.