-
Notifications
You must be signed in to change notification settings - Fork 31
Linter: Update to ruff 0.15.0 #776
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
base: main
Are you sure you want to change the base?
Conversation
| raise ProgrammingError("Cursor closed") | ||
|
|
||
| __next__ = next | ||
| __next__ = next # noqa: A003 |
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.
Without that marker, ruff 0.15.0 would complain like this:
A003 Python builtin is shadowed by method `next` from line 181
--> src/crate/client/cursor.py:196:16
|
194 | raise ProgrammingError("Cursor closed")
195 |
196 | __next__ = next
| ^^^^
197 |
198 | @property
|
Found 1 error.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.
Would you suggest a different mitigation than just suppressing the warning?
| raise ProgrammingError("Cursor closed") | ||
|
|
||
| __next__ = next | ||
| __next__ = next # noqa: A003 |
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 the right choice to use builtins.next?
| __next__ = next # noqa: A003 | |
| __next__ = builtins.next |
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.
Judging from 1d7573e the intention here is to implement the iterator protocol
So why not:
diff --git a/src/crate/client/cursor.py b/src/crate/client/cursor.py
index 587f149..b7aac08 100644
--- a/src/crate/client/cursor.py
+++ b/src/crate/client/cursor.py
@@ -191,11 +191,12 @@ def next(self):
if not self._closed:
return next(self.rows)
else:
raise ProgrammingError("Cursor closed")
- __next__ = next
+ def __next__(self):
+ return self.next()
@property
def description(self):
"""
This read-only attribute is a sequence of 7-item sequences.
mfussenegger
left a comment
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.
See comment regarding the next - otherwise lgtm
Problem
This unrelated patch just failed CI because the ruff linter complained.
3.14t) #773Thoughts
I don't know why the CI run on that update by Dependabot succeeded.I think the CI run on that update by Dependabot didn't run yesterday, because it was submitted at a time when GitHub had outages across the board.