PYTHON-4531 Add back RANGEPREVIEW (#1719)

This commit is contained in:
Shane Harvey 2024-06-28 12:09:00 -07:00 committed by GitHub
parent 13185338f7
commit 2d301e2db2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 46 additions and 8 deletions

View File

@ -8,6 +8,8 @@ PyMongo 4.9 brings a number of improvements including:
- Added support for MongoDB 8.0. - Added support for MongoDB 8.0.
- A new asynchronous API with full asyncio support. - A new asynchronous API with full asyncio support.
- Add support for :attr:`~pymongo.encryption.Algorithm.RANGE` and deprecate
:attr:`~pymongo.encryption.Algorithm.RANGEPREVIEW`.
- pymongocrypt>=1.10 is now required for :ref:`In-Use Encryption` support. - pymongocrypt>=1.10 is now required for :ref:`In-Use Encryption` support.
Issues Resolved Issues Resolved

View File

@ -463,7 +463,14 @@ class Algorithm(str, enum.Enum):
RANGE = "Range" RANGE = "Range"
"""Range. """Range.
.. versionadded:: 4.8 .. versionadded:: 4.9
"""
RANGEPREVIEW = "RangePreview"
"""**DEPRECATED** - RangePreview.
.. note:: Support for RangePreview is deprecated. Use :attr:`Algorithm.RANGE` instead.
.. versionadded:: 4.4
""" """
@ -477,7 +484,18 @@ class QueryType(str, enum.Enum):
"""Used to encrypt a value for an equality query.""" """Used to encrypt a value for an equality query."""
RANGE = "range" RANGE = "range"
"""Used to encrypt a value for a range query.""" """Used to encrypt a value for a range query.
.. versionadded:: 4.9
"""
RANGEPREVIEW = "RangePreview"
"""**DEPRECATED** - Used to encrypt a value for a rangePreview query.
.. note:: Support for RangePreview is deprecated. Use :attr:`QueryType.RANGE` instead.
.. versionadded:: 4.4
"""
def _create_mongocrypt_options(**kwargs: Any) -> MongoCryptOptions: def _create_mongocrypt_options(**kwargs: Any) -> MongoCryptOptions:
@ -847,7 +865,7 @@ class ClientEncryption(Generic[_DocumentType]):
:return: The encrypted value, a :class:`~bson.binary.Binary` with subtype 6. :return: The encrypted value, a :class:`~bson.binary.Binary` with subtype 6.
.. versionchanged:: 4.8 .. versionchanged:: 4.9
Added the `range_opts` parameter. Added the `range_opts` parameter.
.. versionchanged:: 4.7 .. versionchanged:: 4.7
@ -903,7 +921,7 @@ class ClientEncryption(Generic[_DocumentType]):
:return: The encrypted expression, a :class:`~bson.RawBSONDocument`. :return: The encrypted expression, a :class:`~bson.RawBSONDocument`.
.. versionchanged:: 4.8 .. versionchanged:: 4.9
Added the `range_opts` parameter. Added the `range_opts` parameter.
.. versionchanged:: 4.7 .. versionchanged:: 4.7

View File

@ -461,7 +461,14 @@ class Algorithm(str, enum.Enum):
RANGE = "Range" RANGE = "Range"
"""Range. """Range.
.. versionadded:: 4.8 .. versionadded:: 4.9
"""
RANGEPREVIEW = "RangePreview"
"""**DEPRECATED** - RangePreview.
.. note:: Support for RangePreview is deprecated. Use :attr:`Algorithm.RANGE` instead.
.. versionadded:: 4.4
""" """
@ -475,7 +482,18 @@ class QueryType(str, enum.Enum):
"""Used to encrypt a value for an equality query.""" """Used to encrypt a value for an equality query."""
RANGE = "range" RANGE = "range"
"""Used to encrypt a value for a range query.""" """Used to encrypt a value for a range query.
.. versionadded:: 4.9
"""
RANGEPREVIEW = "RangePreview"
"""**DEPRECATED** - Used to encrypt a value for a rangePreview query.
.. note:: Support for RangePreview is deprecated. Use :attr:`QueryType.RANGE` instead.
.. versionadded:: 4.4
"""
def _create_mongocrypt_options(**kwargs: Any) -> MongoCryptOptions: def _create_mongocrypt_options(**kwargs: Any) -> MongoCryptOptions:
@ -845,7 +863,7 @@ class ClientEncryption(Generic[_DocumentType]):
:return: The encrypted value, a :class:`~bson.binary.Binary` with subtype 6. :return: The encrypted value, a :class:`~bson.binary.Binary` with subtype 6.
.. versionchanged:: 4.8 .. versionchanged:: 4.9
Added the `range_opts` parameter. Added the `range_opts` parameter.
.. versionchanged:: 4.7 .. versionchanged:: 4.7
@ -901,7 +919,7 @@ class ClientEncryption(Generic[_DocumentType]):
:return: The encrypted expression, a :class:`~bson.RawBSONDocument`. :return: The encrypted expression, a :class:`~bson.RawBSONDocument`.
.. versionchanged:: 4.8 .. versionchanged:: 4.9
Added the `range_opts` parameter. Added the `range_opts` parameter.
.. versionchanged:: 4.7 .. versionchanged:: 4.7