-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
@@ -516,6 +516,11 @@ class Algorithm(str, enum.Enum): | |||
|
|||
.. versionadded:: 4.4 | |||
""" | |||
TEXTPREVIEW = "TextPreview" |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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.
@ShaneHarvey should we also bump the min dependency of pymongocrypt so users automatically pick up the right version? |
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. |
"foobarbaz", | ||
key_id=self.key1_id, | ||
algorithm=Algorithm.TEXTPREVIEW, | ||
contention_factor=0, |
There was a problem hiding this comment.
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". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asked and answered!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -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, |
There was a problem hiding this comment.
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.
Depends on mongodb/libmongocrypt#1065