Because "Decimal" is not a Python builtins type, and because (py)mongo does not natively json-encode decimal values, and furthermore because existing behavior assumes decimal values will be supplied as floats (as JSON does not support decimals), added case to coerce decimal-typed values to float, and left inline comment explaining decision and options for decimal support in future.
Fixes #613
Type of change
Please delete options that are not relevant.
[x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration, if it is not simply make up-test && make test-run.
[x] test test_changesheet_update_slot_with_range_decimal with supporting files in tests/files
Configuration Details: none
Definition of Done (DoD) Checklist:
[x] My code follows the style guidelines of this project (have you run black nmdc_runtime/?)
[x] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
Description
Because "Decimal" is not a Python
builtins
type, and because (py)mongo does not natively json-encode decimal values, and furthermore because existing behavior assumes decimal values will be supplied as floats (as JSON does not support decimals), added case to coerce decimal-typed values tofloat
, and left inline comment explaining decision and options for decimal support in future.Fixes #613
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration, if it is not simply
make up-test && make test-run
.test_changesheet_update_slot_with_range_decimal
with supporting files intests/files
Configuration Details: none
Definition of Done (DoD) Checklist:
black nmdc_runtime/
?)make up-test && make test-run
)