PYTHON-2292 Fix failing doctest due to UuidRepresentation (#458)

PYTHON-2277 Remove UuidRepresentation DeprecationWarning
This commit is contained in:
Prashant Mital 2020-07-08 15:45:25 -07:00 committed by GitHub
parent 065001ef2e
commit 426f5fdef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View File

@ -252,12 +252,6 @@ class CodecOptions(_options_base):
if not isinstance(tz_aware, bool):
raise TypeError("tz_aware must be True or False")
if uuid_representation is None:
warnings.warn(
"Starting in PyMongo 4.0, the default uuidRepresentation "
"will be changed to 'unspecified'. Applications will need to "
"explicitly set 'uuidRepresentation=pythonLegacy' in the "
"connection string to preserve current behavior.",
DeprecationWarning, stacklevel=2)
uuid_representation = UuidRepresentation.PYTHON_LEGACY
elif uuid_representation not in ALL_UUID_REPRESENTATIONS:
raise ValueError("uuid_representation must be a value "

View File

@ -237,7 +237,7 @@ collection, configured to use :class:`~bson.son.SON` instead of dict:
>>> opts
CodecOptions(document_class=<class 'bson.son.SON'>,
tz_aware=False,
uuid_representation=PYTHON_LEGACY,
uuid_representation=UuidRepresentation.PYTHON_LEGACY,
unicode_decode_error_handler='strict',
tzinfo=None, type_registry=TypeRegistry(type_codecs=[],
fallback_encoder=None))