File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -548,11 +548,10 @@ class QueryType(str, enum.Enum):
548
548
549
549
550
550
def _create_mongocrypt_options (** kwargs : Any ) -> MongoCryptOptions :
551
- opts = MongoCryptOptions (** kwargs )
552
- # Opt into range V2 encryption.
553
- if hasattr (opts , "enable_range_v2" ):
554
- opts .enable_range_v2 = True
555
- return opts
551
+ # For compat with pymongocrypt <1.13, avoid setting the default key_expiration_ms.
552
+ if kwargs .get ("key_expiration_ms" ) is None :
553
+ kwargs .pop ("key_expiration_ms" , None )
554
+ return MongoCryptOptions (** kwargs )
556
555
557
556
558
557
class AsyncClientEncryption (Generic [_DocumentType ]):
Original file line number Diff line number Diff line change @@ -545,11 +545,10 @@ class QueryType(str, enum.Enum):
545
545
546
546
547
547
def _create_mongocrypt_options (** kwargs : Any ) -> MongoCryptOptions :
548
- opts = MongoCryptOptions (** kwargs )
549
- # Opt into range V2 encryption.
550
- if hasattr (opts , "enable_range_v2" ):
551
- opts .enable_range_v2 = True
552
- return opts
548
+ # For compat with pymongocrypt <1.13, avoid setting the default key_expiration_ms.
549
+ if kwargs .get ("key_expiration_ms" ) is None :
550
+ kwargs .pop ("key_expiration_ms" , None )
551
+ return MongoCryptOptions (** kwargs )
553
552
554
553
555
554
class ClientEncryption (Generic [_DocumentType ]):
You can’t perform that action at this time.
0 commit comments