PYTHON-5909 Add GA support for Queryable Encryption string queries - #2981
Draft
aclark4life wants to merge 1 commit into
Draft
PYTHON-5909 Add GA support for Queryable Encryption string queries#2981aclark4life wants to merge 1 commit into
aclark4life wants to merge 1 commit into
Conversation
aclark4life
force-pushed
the
PYTHON-5909
branch
from
August 12, 2026 16:52
9845688 to
694f2ca
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds GA support for Queryable Encryption string queries (prefix/suffix/substring) targeting MongoDB 9.0+, including API updates and refreshed prose/integration coverage, and introduces CI/process changes to better manage uv.lock maintenance.
Changes:
- Introduces
Algorithm.STRING,StringOpts, and GAQueryTypevalues (PREFIX,SUFFIX,SUBSTRING) while deprecatingTextOpts/Algorithm.TEXTPREVIEWand keeping preview query types for pre-9.0 servers. - Updates encryption prose/integration tests (sync + async) to cover GA vs preview behavior, plus adds unit tests for the deprecation shims.
- Adds/adjusts dependency-management workflows and docs around
uv.lock(scheduled lockfile update workflow,uv lock --checkin CI, Dependabot tuning).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_encryption.py | Sync encryption tests updated for string GA/preview query behavior + deprecation shim tests. |
| test/asynchronous/test_encryption.py | Async encryption tests updated for string GA/preview query behavior + deprecation shim tests. |
| pymongo/encryption_options.py | Adds StringOpts; deprecates TextOpts as a compatibility shim. |
| pymongo/synchronous/encryption.py | Sync encryption API updated to accept string_opts and deprecate text_opts; adds GA string/query enums. |
| pymongo/asynchronous/encryption.py | Async encryption API updated to accept string_opts and deprecate text_opts; adds GA string/query enums. |
| doc/changelog.rst | Documents GA support and the new/Deprecated APIs. |
| pyproject.toml | Adjusts uv dependency constraints to avoid problematic back-solving for boto3 across forks. |
| CONTRIBUTING.md | Updates dependency/lockfile workflow guidance for contributors. |
| .pre-commit-config.yaml | Excludes uv.lock from the large-file pre-commit check. |
| .gitignore | Stops ignoring uv.lock so it can be committed/checked. |
| .github/workflows/uv-lock-update.yml | New scheduled workflow to regularly update uv.lock. |
| .github/workflows/test-python.yml | Adds uv lock --check and removes the custom exclude-newer action usage. |
| .github/dependabot.yml | Disables routine uv version-update PRs (handled by the scheduled uv-lock-update workflow). |
| .github/actions/set-uv-exclude-newer/action.yml | Removes the custom action previously used to set UV_EXCLUDE_NEWER. |
| .evergreen/run-mongodb-aws-ecs-test.sh | Stops deleting uv.lock, aligning with committed lockfile usage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| return string_opts | ||
| if string_opts is not None: | ||
| raise ConfigurationError("Cannot set both string_opts and text_opts") | ||
| warnings.warn( |
| stacklevel=3, | ||
| ) | ||
| return text_opts | ||
|
|
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-5909
Adds general availability support for Queryable Encryption prefix, suffix, and substring queries against MongoDB 9.0+ (requires libmongocrypt 1.20.0+).
Algorithm.STRINGandStringOptsreplaceAlgorithm.TEXTPREVIEWandTextOpts, which are now deprecated.QueryType.PREFIX,QueryType.SUFFIX, andQueryType.SUBSTRING. The*PREVIEWquery types remain for experimental use with pre-9.0 servers.ClientEncryption.encrypt()/AsyncClientEncryption.encrypt()gain astring_optsparameter;text_optsis kept as a deprecated alias and raisesConfigurationErrorif both are passed.