tableau / TabPy

Execute Python code on the fly and display results in Tableau visualizations:
https://tableau.github.io/TabPy/
MIT License
1.56k stars 598 forks source link

Convert NaNs to Nulls during json serialization #377

Closed tfoldi closed 4 years ago

tfoldi commented 4 years ago

NaN values in arrays cause serialization issues in Desktop/Server. All NaN should be converted to null when returning from rest api

pep8speaks commented 4 years ago

Hello @tfoldi! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2019-12-20 01:49:45 UTC
tfoldi commented 4 years ago

I'm still not happy with the change, as I guess we have to change all json dumps to simplejson from json. What do you think?

Maybe a more generic solution could be to do:

try:
    import simplejson as json
except ImportError:
    import json

Plus, do you need any test case to reproduce the NaN issue or you guys just believe me (which is perfectly fine)