-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
to_json index with Null Value Broken in 1.0 #31801
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
Comments
on master the pd.NA case is now giving @WillAyd what is the desired behavior here? do you have a gameplan for this? |
I'm not actively working on this but if someone wanted to I think the best solution is to take the NA check while encoding object keys: pandas/pandas/_libs/src/ujson/python/objToJSON.c Line 1455 in 6d3cc14
And move it up in the function so it gets hit generally. The |
d75ee70 is the first bad commit
|
this was fixed by #32214 35537dd is the first new commit
|
this was also initially broken by #27618 >>> import pandas as pd
>>>
>>> pd.__version__
'0.26.0.dev0+228.gd75ee703e'
>>>
>>> pd.Series([1], index=[pd.NaT]).to_json()
'{"-9223372036854":1}'
>>> however, this was fixed in #30977 9c33464 is the first new commit
|
Discovered by @ArtificialQualia in #31748
Previous behavior on 0.25.3:
And now on master:
Note that pd.NA also just has its str representation written out:
pd.NaT still works because of this logic:
pandas/pandas/_libs/src/ujson/python/objToJSON.c
Line 1455 in 6d3cc14
So probably need to generalize for other "null" values
The text was updated successfully, but these errors were encountered: