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

Numpy NaN handling #852

Open
zifeo opened this issue Oct 29, 2018 · 7 comments
Open

Numpy NaN handling #852

zifeo opened this issue Oct 29, 2018 · 7 comments

Comments

@zifeo
Copy link

zifeo commented Oct 29, 2018

Currently when a [Float] type resolves to np.array([1, np.nan]) the generated payload is [1, NaN] which is not json-compilant (rather than null) without any warning. A custom scalar can do the job however as numpy is so widely used, maybe this should be supported out of the box?

@stale
Copy link

stale bot commented Jul 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 29, 2019
@stale stale bot closed this as completed Aug 5, 2019
@Manelmc
Copy link

Manelmc commented Apr 10, 2020

This is still happening, is there any particular reason for resolving np.nan with NaN in type Float? I think a json compliant solution (null as @zifeo suggested) should be supported.

@zifeo
Copy link
Author

zifeo commented Apr 10, 2020

Still an issue

@jkimbo
Copy link
Member

jkimbo commented Apr 12, 2020

@zifeo if you would like to create a PR with a custom scalar for Numpy I will happily merge it. Unfortunately I don't have the time to work on this at the moment.

@zifeo
Copy link
Author

zifeo commented Apr 12, 2020

@jkimbo not sure when I will have the time yet, however can you reopen the issue?

@jkimbo
Copy link
Member

jkimbo commented Apr 12, 2020

Yep

@olejorgenb
Copy link

This is an issue AFAIK for all special float values (not really numpy specific) nan, inf, -inf. It's really a pain that json lack a standard way of serializing floats.. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants