Skip to content
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

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Sep 17, 2024

We need to update flake8 to fix a false-positive that appears with older flake8 versions on Python 3.12.

@bdice bdice requested review from a team as code owners September 17, 2024 17:46
@bdice bdice requested a review from AyodeAwe September 17, 2024 17:46
@jameslamb jameslamb added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Sep 17, 2024
Copy link
Member

@jameslamb jameslamb left a 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 = []
Copy link
Member

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__().

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.

Copy link
Contributor Author

@bdice bdice Sep 17, 2024

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?

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @AjayThorve for awareness

Copy link
Member

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

@jameslamb jameslamb requested review from jameslamb and removed request for AyodeAwe September 17, 2024 18:36
Copy link
Member

@AjayThorve AjayThorve left a 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 = []
Copy link
Member

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

@AjayThorve
Copy link
Member

AjayThorve commented Sep 17, 2024

seems like the CI is failing due to a new dependency introduced to bokeh_sampledata. Would need to add it to dependencies.yaml to fix the issue for notebooks and docs.

pushing the changes to this PR

@AjayThorve AjayThorve requested a review from a team as a code owner September 17, 2024 20:54
@github-actions github-actions bot added the conda label Sep 17, 2024
@bdice
Copy link
Contributor Author

bdice commented Sep 18, 2024

/merge

@rapids-bot rapids-bot bot merged commit 6981ae6 into rapidsai:branch-24.10 Sep 18, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conda improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants