-
Notifications
You must be signed in to change notification settings - Fork 70
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
Update to flake8 7.1.1. #627
Update to flake8 7.1.1. #627
Conversation
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.
Support updating flake8
, but I left one comment... I'm concerned about the change to BaseStackedLine
.
@@ -21,7 +21,6 @@ class BaseStackedLine(BaseChart): | |||
y_range: Tuple = None | |||
use_data_tiles = False | |||
y: list = [] | |||
colors: list = [] |
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.
This one doesn't look right to me. I don't see self.colors
getting set in __init__()
.
def __init__( |
And I found at least one place that appears to rely on this attribute being defined on an instance:
class StackedLines(BaseStackedLine): |
colors = colors or self.colors |
What was the the flake8
error that this change addresses? Maybe there's another way we could address it, like a more specific type hint in the initialization of colors
.
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.
colors
is also defined as a property here:
@property | |
def colors(self): | |
if self.colors_set: | |
return list(self._colors_input) | |
return self.default_colors * len(self.y) |
flake8 was mad that this object had both an attribute and a property with the same name, and it seemed to me that the property was the correct choice to keep. What do you think?
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.
ahhhh my git grep -E '\.colors
' wouldn't have caught it being defined with @property
, should have thought of that!
Ok then yeah this is totally fine, and I agree with preferring the @property
one. Thanks for explaining that.
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.
cc: @AjayThorve for awareness
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.
thanks, this seems correct, and yes property is the right one to keep
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.
LGTM, thanks!
@@ -21,7 +21,6 @@ class BaseStackedLine(BaseChart): | |||
y_range: Tuple = None | |||
use_data_tiles = False | |||
y: list = [] | |||
colors: list = [] |
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.
thanks, this seems correct, and yes property is the right one to keep
seems like the CI is failing due to a new dependency introduced to pushing the changes to this PR |
/merge |
We need to update flake8 to fix a false-positive that appears with older flake8 versions on Python 3.12.