Repository navigation
Conversation
NoahStapp
requested review from
aclark4life
and
a balanced review from Copilot
November 17, 2026 14:57
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the Ruff FURB enablement and related lint-driven code changes.
No open issues 🎉
What changed in this PR
Enables Ruff’s full FURB rule family and updates driver code, tests, and tooling to satisfy the new lint checks.
Changes:
- Adds
FURBto Ruff’s enabled rules. - Replaces single-item membership checks with equality comparisons.
- Simplifies client-list fallbacks in asynchronous tests and their generated synchronous counterparts.
| File | Description |
|---|---|
test/unified_format.py |
Simplifies the generated synchronous session-cleanup client fallback. |
test/test_transactions.py |
Simplifies the generated synchronous fail-point client fallback. |
test/test_bson_binary_vector.py |
Uses equality for the FLOAT32 type check. |
test/asynchronous/unified_format.py |
Simplifies the session-cleanup client fallback. |
test/asynchronous/test_transactions.py |
Simplifies the fail-point client fallback. |
pyproject.toml |
Enables the FURB rule family. |
pymongo/errors.py |
Uses equality to identify timeout error code 50. |
pymongo/common.py |
Uses equality for the ALLOWED_HOSTS property check. |
.evergreen/scripts/resync_all_specs.py |
Uses equality when excluding the asynchronous directory. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-6281
Changes in this PR
Enable the entire suite of ruff
FURBrules and make the required code changes to pass them.Test Plan
Existing test suite.
Checklist
Checklist for Author
[ ] Did you update the changelog (if necessary)?[ ] Is there test coverage?[ ] Is any followup work tracked in a JIRA ticket? If so, add link(s).Checklist for Reviewer