metno / aerovaldb

aerovaldb is the database-interface used in the aeroval-API to send data to aeroval database instances like https://aeroval.met.no . Data is usually provided by PyAerocom.
https://aerovaldb.readthedocs.io
GNU General Public License v3.0
1 stars 1 forks source link

Fix json nan-serialization #59

Closed thorbjoernl closed 3 months ago

thorbjoernl commented 3 months ago

Change Summary

Use ignore_nan=True when writing json, which writes compliant json and fixes an issue where aeroval-web can't parse generated json.

Related issue number

https://github.com/metno/pyaerocom/issues/1288

Checklist

Additional Notes

This introduces a potential issue in that the data written by aerovaldb will not be the same when read in for nan values. aerovaldb writes nan as null, then reads null as None when reading. AFAICT this matches the old behavior of pyaerocom as seen in the write_json and read_json methods respectively, so I am leaving this as is for now.