-
-
Notifications
You must be signed in to change notification settings - Fork 403
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
Enable bugbear lint #5861
Enable bugbear lint #5861
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5861 +/- ##
==========================================
- Coverage 88.58% 88.36% -0.22%
==========================================
Files 313 313
Lines 65066 65302 +236
==========================================
+ Hits 57636 57703 +67
- Misses 7430 7599 +169
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
01ef89d
to
3163a6a
Compare
@@ -14,7 +14,9 @@ def _build_selection(self, el, exprs, **kwargs): | |||
opts['selected'] = list(np.where(mask)[0]) | |||
return el.opts(clone=True, backend='bokeh', **opts) | |||
|
|||
def build_selection(self, selection_streams, hvobj, operations, region_stream=None, cache={}): | |||
def build_selection(self, selection_streams, hvobj, operations, region_stream=None, cache=None): |
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.
Is it okay to change cache here?
raise NotImplementedError() | ||
|
||
@staticmethod | ||
def _select(element, selection_expr, cache={}): | ||
def _select(element, selection_expr, cache=None): |
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.
Is it okay to change cache here?
@@ -645,7 +649,9 @@ def __init__(self, color_prop='color', alpha_prop='alpha', backend=None): | |||
self.alpha_props = [alpha_prop] | |||
self.backend = backend | |||
|
|||
def build_selection(self, selection_streams, hvobj, operations, region_stream=None, cache={}): | |||
def build_selection(self, selection_streams, hvobj, operations, region_stream=None, cache=None): |
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.
Is it okay to change cache here?
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.
Yes, I think that's correct. The idea is that you can pass in an external cache.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Continuation of work done in #5768
As mentioned in #5621 (comment), we want to add a linter to remove mutable objects in functions/methods signatures and with the release of Ruff 0.0.285, there now is an auto-fix for it in the ruleset Bugbear (B) in B006.
I have enabled the Bugbear rule and updated the code to comply with it. Two warnings are still in the code as I can see if this is expected behavior or if it is a real bug. EDIT: Not a bug, so I have replaced it with
v
with_
.holoviews/holoviews/plotting/util.py
Lines 228 to 236 in c1dc5b5