PYTHON-5328 CRUD Support in Driver for Prefix/Suffix/Substring Indexes#2521
PYTHON-5328 CRUD Support in Driver for Prefix/Suffix/Substring Indexes#2521blink1073 merged 5 commits intomongodb:masterfrom
Conversation
|
|
||
| .. versionadded:: 4.4 | ||
| """ | ||
| TEXTPREVIEW = "TextPreview" |
There was a problem hiding this comment.
Are we required to call this TEXTPREVIEW instead of calling it TEXT and designating "feature preview"?
There was a problem hiding this comment.
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.
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". |
| 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.
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