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

ValueError: Expected object or value - ujson does not support NaN #187

Open
danylott opened this issue Jul 19, 2021 · 0 comments
Open

ValueError: Expected object or value - ujson does not support NaN #187

danylott opened this issue Jul 19, 2021 · 0 comments

Comments

@danylott
Copy link
Contributor

panini uses ujson.loads for bytes loading,
but it does not support NaN, when common json module supports it:

# This code will work:
json.loads(b'{"success":true,"data":[{"open":NaN,"high":NaN,"low":NaN,"close":NaN,"volume":0.0,"timestamp":1626427980000},{"open":NaN,"high":NaN,"low":NaN,"close":NaN,"volume":0.0,"timestamp":1626428040000}]}')

# When this will throw an error - ValueError: Expected object or value:
ujson.loads(b'{"success":true,"data":[{"open":NaN,"high":NaN,"low":NaN,"close":NaN,"volume":0.0,"timestamp":1626427980000},{"open":NaN,"high":NaN,"low":NaN,"close":NaN,"volume":0.0,"timestamp":1626428040000}]}')
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

No branches or pull requests

1 participant