singer-io / singer-python

Writes the Singer format from Python
https://singer.io
Apache License 2.0
538 stars 128 forks source link

Messages are not valid JSON #127

Open rpaterson opened 4 years ago

rpaterson commented 4 years ago

The message formatting utility https://github.com/singer-io/singer-python/blob/master/singer/messages.py#L222 uses the simplejson library. By default simplejson does not produce valid JSON:

If allow_nan is true (the default), then NaN, Infinity, and -Infinity will be encoded
as such. This behavior is not JSON specification compliant, but is consistent with
most JavaScript based encoders and decoders. Otherwise, it will be a ValueError
to encode such floats. See also ignore_nan for ECMA-262 compliant behavior.

I'm getting an error trying to parse record messages from tap-salesforce using NodeJS because it's producing invalid JSON that contains NaN.