PYTHON-5758 Remove unused validation functions#2733
Merged
aclark4life merged 2 commits intomongodb:masterfrom Mar 18, 2026
Merged
PYTHON-5758 Remove unused validation functions#2733aclark4life merged 2 commits intomongodb:masterfrom
aclark4life merged 2 commits intomongodb:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes three unused internal validation helpers from pymongo/common.py and documents the cleanup in the 4.17.0 changelog.
Changes:
- Removed unused validation helpers from
pymongo/common.py. - Added a changelog entry describing the removal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pymongo/common.py |
Deletes unused validation functions (and should fully remove related now-dead constants). |
doc/changelog.rst |
Documents the removal in the 4.17.0 changelog entry. |
pymongo/common.py
Outdated
Comment on lines
799
to
801
| _AUTH_OPTIONS = frozenset(["authmechanismproperties"]) | ||
|
|
||
|
|
doc/changelog.rst
Outdated
Comment on lines
+9
to
+16
| - Remove unused validation functions from pymongo/common.py | ||
|
|
||
| - validate_positive_integer_or_none (line 236) — superseded by | ||
| validate_non_negative_integer_or_none which is used | ||
| - validate_int_or_basestring (line 264) — a variant of | ||
| validate_non_negative_int_or_basestring which is used | ||
| - validate_auth_option (line 823) — validates auth mechanism properties but | ||
| is never invoked |
Jibola
previously approved these changes
Mar 17, 2026
doc/changelog.rst
Outdated
Comment on lines
+10
to
+15
|
|
||
| - ``validate_positive_integer_or_none`` (internal helper, no longer used) | ||
| - ``validate_int_or_basestring`` (internal helper, no longer used) | ||
| - ``validate_auth_option`` (validated auth mechanism properties but was never | ||
| used) | ||
|
|
Contributor
There was a problem hiding this comment.
Suggested change
| - ``validate_positive_integer_or_none`` (internal helper, no longer used) | |
| - ``validate_int_or_basestring`` (internal helper, no longer used) | |
| - ``validate_auth_option`` (validated auth mechanism properties but was never | |
| used) |
We don't need to get into specifics since these are internal functions.
NoahStapp
requested changes
Mar 17, 2026
doc/changelog.rst
Outdated
|
|
||
| PyMongo 4.17 brings a number of changes including: | ||
|
|
||
| - Remove unused validation functions from pymongo/common.py |
Contributor
There was a problem hiding this comment.
We don't document pymongo/common.py or its contents in any of our documentation. These methods are technically public, but users would have no way of finding them except by reading the source code. I don't think we need to mention them here.
7832b0a to
9314d69
Compare
NoahStapp
approved these changes
Mar 18, 2026
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.
INTPYTHON-5758
Changes in this PR
Remove unused validation functions from pymongo/common.py
Test Plan
N/A. Unused and non-public so removed without deprecation.
Checklist
Checklist for Author
Checklist for Reviewer