Skip to content

Commit 4c55088

Browse files
authored
Merge pull request #2739 from ShaneHarvey/uuidRepr-deprecation-warning
Update uuidRepresentation warnings with "unspecified" as the future default
2 parents d0e7564 + 9b879d1 commit 4c55088

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

mongoengine/base/document.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ def to_json(self, *args, **kwargs):
450450
"No 'json_options' are specified! Falling back to "
451451
"LEGACY_JSON_OPTIONS with uuid_representation=PYTHON_LEGACY. "
452452
"For use with other MongoDB drivers specify the UUID "
453-
"representation to use.",
453+
"representation to use. This will be changed to "
454+
"uuid_representation=UNSPECIFIED in a future release.",
454455
DeprecationWarning,
455456
)
456457
kwargs["json_options"] = LEGACY_JSON_OPTIONS
@@ -480,7 +481,8 @@ def from_json(cls, json_data, created=False, **kwargs):
480481
"No 'json_options' are specified! Falling back to "
481482
"LEGACY_JSON_OPTIONS with uuid_representation=PYTHON_LEGACY. "
482483
"For use with other MongoDB drivers specify the UUID "
483-
"representation to use.",
484+
"representation to use. This will be changed to "
485+
"uuid_representation=UNSPECIFIED in a future release.",
484486
DeprecationWarning,
485487
)
486488
kwargs["json_options"] = LEGACY_JSON_OPTIONS

mongoengine/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def _get_connection_settings(
177177
"For compatibility with other MongoDB drivers this should be "
178178
"specified as 'standard' or '{java,csharp}Legacy' to work with "
179179
"older drivers in those languages. This will be changed to "
180-
"'standard' in a future release.",
180+
"'unspecified' in a future release.",
181181
DeprecationWarning,
182182
)
183183
kwargs["uuidRepresentation"] = "pythonLegacy"

mongoengine/pymongo_support.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
PYMONGO_VERSION = tuple(pymongo.version_tuple[:2])
99

10+
# This will be changed to UuidRepresentation.UNSPECIFIED in a future
11+
# (breaking) release.
1012
if PYMONGO_VERSION >= (4,):
1113
LEGACY_JSON_OPTIONS = json_util.LEGACY_JSON_OPTIONS.with_options(
1214
uuid_representation=binary.UuidRepresentation.PYTHON_LEGACY,

mongoengine/queryset/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,8 @@ def to_json(self, *args, **kwargs):
12831283
"No 'json_options' are specified! Falling back to "
12841284
"LEGACY_JSON_OPTIONS with uuid_representation=PYTHON_LEGACY. "
12851285
"For use with other MongoDB drivers specify the UUID "
1286-
"representation to use.",
1286+
"representation to use. This will be changed to "
1287+
"uuid_representation=UNSPECIFIED in a future release.",
12871288
DeprecationWarning,
12881289
)
12891290
kwargs["json_options"] = LEGACY_JSON_OPTIONS

0 commit comments

Comments
 (0)