<#3019 fix: Encode `nan`, `inf` and `-inf` values ...
# meltano-repo-activity
g
#3019 fix: Encode
nan
,
inf
and
-inf
values as
null
in Singer stream
Pull request opened by edgarrmondragon Changes the behavior of JSON serialization for Singer output to convert
nan
,
inf
and
-inf
values to
null
in compliance with the ECMA-262 specification. ## Implementation details •
simplejson
supports this with the `ignore_nan=True`1 parameter. •
msgspec
already does this by default2. ## Related • Closes #2213 ## Summary by Sourcery Modify JSON serialization in Singer output to convert special float values (
nan
,
inf
,
-inf
) to
null
Bug Fixes: • Ensure proper handling of special float values in JSON serialization Tests: • Add test case to verify
nan
values are encoded as
null
--- 📚 Documentation preview 📚: https://meltano-sdk--3019.org.readthedocs.build/en/3019/ ## Footnotes 1. https://simplejson.readthedocs.io/en/latest/#simplejson.dumps ↩️ 2. https://jcristharif.com/msgspec/supported-types.html#float ↩️ meltano/sdk