You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
are flagged as E712 violations, however the fix is invalid, and worse it silently changes the result of the query, causing subtle and hard to find errors.
I believe this fix is marked as unsafe for this reason. Did you opt-in to the fix with --unsafe-fixes, or do you have unsafe-fixes = true enabled in your project? If so, I think Ruff's behavior here is okay... I'd love to make sure we don't flag these at all, but at least it's not a silent breakage, and instead one that's surfaced to the user as potentially-unsafe.
(I'm going to merge this ticket into #4560 which tracks the underlying limitation.)
@charliermarsh I think what I probably did is manually apply the fix in vscode (i.e. right click on the squiggle generated by the ruff vscode extensions) as I defn don't have --unsafe-fixes set.
So I guess the issue here is the extension might have displayed safe and unsafe fixes in the same colour (i.e. yellow underline) or perhaps I just didn't read the message correctly. Either way that issue should be raise in the ruff vscode extension repo so I'll double check and raise it there.
The following fragments
are flagged as E712 violations, however the fix is invalid, and worse it silently changes the result of the query, causing subtle and hard to find errors.
The correct fix is
and for completeness,
==False
should be replaced byThe text was updated successfully, but these errors were encountered: