-
Type: Task
-
Resolution: Done
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
The Handling out of range datetimes section could use some improvements:
https://pymongo.readthedocs.io/en/latest/examples/datetimes.html?highlight=datetimems#handling-out-of-range-datetimes
First, the code example does not render and shows up blank. Checking the doctest:
[2022/07/28 17:32:10.106] Document: faq [2022/07/28 17:32:10.106] ------------- [2022/07/28 17:32:10.106] ********************************************************************** [2022/07/28 17:32:10.106] File "faq.rst", line 263, in key-order [2022/07/28 17:32:10.106] Failed example: [2022/07/28 17:32:10.106] opts [2022/07/28 17:32:10.106] Expected: [2022/07/28 17:32:10.106] CodecOptions(document_class=...SON..., tz_aware=False, uuid_representation=UuidRepresentation.UNSPECIFIED, unicode_decode_error_handler='strict', tzinfo=None, type_registry=TypeRegistry(type_codecs=[], fallback_encoder=None)) [2022/07/28 17:32:10.106] Got: [2022/07/28 17:32:10.106] CodecOptions(document_class=<class 'bson.son.SON'>, tz_aware=False, uuid_representation=UuidRepresentation.UNSPECIFIED, unicode_decode_error_handler='strict', tzinfo=None, type_registry=TypeRegistry(type_codecs=[], fallback_encoder=None), datetime_conversion=1) [2022/07/28 17:32:10.108] ********************************************************************** [2022/07/28 17:32:10.108] 1 items had failures: [2022/07/28 17:32:10.108] 1 of 5 in key-order [2022/07/28 17:32:10.108] 5 tests in 1 items. [2022/07/28 17:32:10.108] 4 passed and 1 failed. [2022/07/28 17:32:10.108] ***Test Failed*** 1 failures.
And later:
[2022/07/28 17:32:14.379] WARNING: no code/output in doctest block at examples/datetimes.rst:143
Second, we should add more examples to show the decoding behavior of each DatetimeConversionOpts.