Context
Since we can't auto-convert Decimal128 to decimal.Decimal for reasons explained in PYTHON-5395, we should add correct implementations of the DecimalEncoder and DecimalDecoder codec classes we currently have in test_custom_types.py.
Definition of done
Provide publicly accessible and documented DecimalEncoder and DecimalDecoder codec classes. Our examples will need to be updated to reference these new classes.
Pitfalls
The Decimal128 specification requires us to warn users that converting from a BSON data type to a builtin data type could result in data loss.
- is derived by
-
PYTHON-5395 Add convert_decimal to CodecOptions
-
- Closed
-