PYTHON-3310 Test Failure - query_type must be str or None, not: <enum 'QueryType'> (#978)
This commit is contained in:
parent
4ae93c4937
commit
3169f1fe31
@ -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`.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user