PYTHON-5540 Fix usage of text_opts for older versions of pymongocrypt (#2525)

This commit is contained in:
Steven Silvester 2025-09-10 16:38:55 -05:00 committed by GitHub
parent 527cbdd18a
commit 2b148867e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -935,7 +935,8 @@ class AsyncClientEncryption(Generic[_DocumentType]):
contention_factor=contention_factor,
range_opts=range_opts_bytes,
is_expression=is_expression,
text_opts=text_opts_bytes,
# For compatibility with pymongocrypt < 1.16:
**{"text_opts": text_opts_bytes} if text_opts_bytes else {},
)
return decode(encrypted_doc)["v"]

View File

@ -928,7 +928,8 @@ class ClientEncryption(Generic[_DocumentType]):
contention_factor=contention_factor,
range_opts=range_opts_bytes,
is_expression=is_expression,
text_opts=text_opts_bytes,
# For compatibility with pymongocrypt < 1.16:
**{"text_opts": text_opts_bytes} if text_opts_bytes else {},
)
return decode(encrypted_doc)["v"]