Skip to content

fix: replace NaN with null in JSON reports (#18)#19

Merged
maskedsyntax merged 1 commit intomainfrom
fix/json-nan-issue
Sep 25, 2025
Merged

fix: replace NaN with null in JSON reports (#18)#19
maskedsyntax merged 1 commit intomainfrom
fix/json-nan-issue

Conversation

@maskedsyntax
Copy link
Copy Markdown
Member

Summary

This PR fixes issue #18 where JSON reports contained NaN instead of null, making them invalid JSON.

Changes

  • updated json_numpy_handler in hashprep/reports/json.py
  • converts NaN/None values to null
  • added safe handling for NumPy + Pandas missing values

Example

Before:

{ "Age": NaN }

After:

{ "Age": null }

Related Issue

Fixes #18

- updated json_numpy_handler to convert NaN/None to null
- ensures generated JSON is valid and parsable
@vercel
Copy link
Copy Markdown

vercel bot commented Sep 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hashprep Ready Ready Preview Comment Sep 25, 2025 7:37am

@maskedsyntax maskedsyntax merged commit 01b433a into main Sep 25, 2025
2 checks passed
@maskedsyntax maskedsyntax deleted the fix/json-nan-issue branch September 27, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON report contains NaN instead of null

1 participant