Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix json nan-serialization #59

Merged
merged 4 commits into from
Jul 30, 2024
Merged

Fix json nan-serialization #59

merged 4 commits into from
Jul 30, 2024

Conversation

thorbjoernl
Copy link
Collaborator

@thorbjoernl thorbjoernl commented Jul 30, 2024

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

metno/pyaerocom#1288

Checklist

  • Start with a draft-PR
  • The PR title is a good summary of the changes
  • PR is set to AeroTools and a tentative milestone
  • Documentation reflects the changes where applicable
  • Tests for the changes exist where applicable
  • Tests pass locally
  • Tests pass on CI
  • At least 1 reviewer is selected
  • Make PR ready to review

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.

@thorbjoernl thorbjoernl added this to the m2024-08 milestone Jul 30, 2024
@thorbjoernl thorbjoernl added the bug Something isn't working label Jul 30, 2024
@thorbjoernl thorbjoernl self-assigned this Jul 30, 2024
@thorbjoernl thorbjoernl marked this pull request as ready for review July 30, 2024 11:11
@thorbjoernl thorbjoernl merged commit 520b33b into main Jul 30, 2024
2 checks passed
@thorbjoernl thorbjoernl deleted the missing-ignore-nan branch July 30, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant