From 3169f1fe314e448dea7126ba85ac0d2cd7ea836e Mon Sep 17 00:00:00 2001 From: Julius Park Date: Tue, 21 Jun 2022 10:46:49 -0700 Subject: [PATCH] PYTHON-3310 Test Failure - query_type must be str or None, not: (#978) --- pymongo/encryption.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymongo/encryption.py b/pymongo/encryption.py index 0a8bf69a3..a49cf7df5 100644 --- a/pymongo/encryption.py +++ b/pymongo/encryption.py @@ -394,7 +394,7 @@ class Algorithm(str, enum.Enum): """ -class QueryType(enum.IntEnum): +class QueryType(str, enum.Enum): """**(BETA)** An enum that defines the supported values for explicit encryption query_type. .. note:: Support for Queryable Encryption is in beta. @@ -403,7 +403,7 @@ class QueryType(enum.IntEnum): .. versionadded:: 4.2 """ - EQUALITY = 1 + EQUALITY = "equality" """Used to encrypt a value for an equality query.""" @@ -599,7 +599,7 @@ class ClientEncryption(object): key_id: Optional[Binary] = None, key_alt_name: Optional[str] = None, index_key_id: Optional[Binary] = None, - query_type: Optional[int] = None, + query_type: Optional[str] = None, contention_factor: Optional[int] = None, ) -> Binary: """Encrypt a BSON value with a given key and algorithm. @@ -617,7 +617,7 @@ class ClientEncryption(object): - `key_alt_name`: Identifies a key vault document by 'keyAltName'. - `index_key_id`: **(BETA)** The index key id to use for Queryable Encryption. Must be a :class:`~bson.binary.Binary` with subtype 4 (:attr:`~bson.binary.UUID_SUBTYPE`). - - `query_type` (int): **(BETA)** The query type to execute. See + - `query_type` (str): **(BETA)** The query type to execute. See :class:`QueryType` for valid options. - `contention_factor` (int): **(BETA)** The contention factor to use when the algorithm is :attr:`Algorithm.INDEXED`.