Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PYTHON-5328 CRUD Support in Driver for Prefix/Suffix/Substring Indexes #2521

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

Merged
blink1073 merged 5 commits into mongodb:master from blink1073:PYTHON-5328
Sep 10, 2025

Conversation

Copy link
Member

@blink1073 blink1073 commented Sep 9, 2025
edited
Loading

Depends on mongodb/libmongocrypt#1065

  • Update libmongocrypt to 1.15.1. Done in PYTHON-5489
  • Sync spec tests for auto encryption. Done in PYTHON-5143.
  • Expose textPreview options. Pass them to libmongcrypt with mongocrypt_ctx_setopt_algorithm_text. Done in PYTHON-5531 and this PR.
  • Implement prose tests for explicit encryption. Done in this PR.

@blink1073 blink1073 marked this pull request as ready for review September 9, 2025 15:03
@blink1073 blink1073 requested a review from a team as a code owner September 9, 2025 15:03
@blink1073 blink1073 marked this pull request as draft September 9, 2025 15:03
@@ -516,6 +516,11 @@ class Algorithm(str, enum.Enum):

.. versionadded:: 4.4
"""
TEXTPREVIEW = "TextPreview"
Copy link
Contributor

@aclark4life aclark4life Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we required to call this TEXTPREVIEW instead of calling it TEXT and designating "feature preview"?

Copy link
Member Author

@blink1073 blink1073 Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, following the pattern we used for RANGEPREVIEW, to ensure that if the semantics change it won't do so silently.

aclark4life reacted with thumbs up emoji
@blink1073 blink1073 marked this pull request as ready for review September 9, 2025 16:47
Copy link
Member Author

@ShaneHarvey should we also bump the min dependency of pymongocrypt so users automatically pick up the right version?

Copy link
Member

We usually only bump the min version if the new pymongo version is incompatible. If that's not the case I'd say the version should remain the same.

blink1073 reacted with thumbs up emoji

"foobarbaz",
key_id=self.key1_id,
algorithm=Algorithm.TEXTPREVIEW,
contention_factor=0,
Copy link
Contributor

@aclark4life aclark4life Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 is the default right ? And if so do we need to include it here?

query_type=QueryType.PREFIXPREVIEW,
text_opts=text_opts,
)
# Expect an error from libmongocrypt with a message containing the string: "contention factor is required for textPreview algorithm".
Copy link
Contributor

@aclark4life aclark4life Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked and answered!

Copy link
Contributor

@aclark4life aclark4life left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blink1073 blink1073 merged commit d7316af into mongodb:master Sep 10, 2025
80 checks passed
@blink1073 blink1073 deleted the PYTHON-5328 branch September 10, 2025 15:35
@@ -905,6 +935,7 @@ async def _encrypt_helper(
contention_factor=contention_factor,
range_opts=range_opts_bytes,
is_expression=is_expression,
text_opts=text_opts_bytes,
Copy link
Member

@ShaneHarvey ShaneHarvey Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing text_opts even when it's None will fail on old versions of pymongocrypt. So we need to bump the min version or avoid passing text_opts by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@ShaneHarvey ShaneHarvey ShaneHarvey left review comments

@aclark4life aclark4life aclark4life approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /