-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
STY: Enable some passing rules #57200
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
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.
Generally LGTM, small comment.
@@ -55,15 +55,15 @@ def test_array_scalar_like_equivalence(data, all_arithmetic_operators): | |||
scalar_array = pd.array([scalar] * len(data), dtype=data.dtype) | |||
|
|||
# TODO also add len-1 array (np.array([scalar], dtype=data.dtype.numpy_dtype)) | |||
for scalar in [scalar, data.dtype.type(scalar)]: | |||
for val in [scalar, data.dtype.type(scalar)]: |
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.
What rule is this?
Not sure I like this change (or if its worth the churn).
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.
https://docs.astral.sh/ruff/rules/loop-variable-overrides-iterator/
I think this could be useful generally. In the file above (pandas/io/json/_normalize.py
), if v
needed to be used after looping it would no longer be the original object it would be an object element
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.
My bad, wasn't paying too close attention.
I guess a more descriptive name would be nicer, but I'm fine with it as it is.
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 @mroeschke
* Enable B006 * Enable B011 * Enable B019 * Enable B020 * Enable B020 * Enable PYI and othe rule * Enable PLC1901 * Use values instead of items * Use union * Ignore one case
No description provided.