-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
TST (string dtype): resolve all xfails in JSON IO tests #60318
TST (string dtype): resolve all xfails in JSON IO tests #60318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
pandas/tests/io/json/test_pandas.py
Outdated
@@ -710,6 +707,9 @@ def test_series_roundtrip_object(self, orient, dtype, object_series): | |||
if orient != "split": | |||
expected.name = None | |||
|
|||
if using_string_dtype(): | |||
expected = expected.astype(pd.StringDtype(na_value=np.nan)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW you can also use the shorter astype("str")
for general cases where you want to ensure the default string dtype is used (and which might additionally also be more forward looking if at some point the default na_value changes, then we would have less work updating the tests)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know - I missed that on the prior SQL PR so will go back and do that too, so we have one consistent method internally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think on the sql PR you wanted to construct the actual dtype instance? In that case the above is fine. I am mostly using "str"
in the tests.
While looking at centralizing |
Interesting - I didn't even realize we had a pyarrow engine for JSON! Is your expectation that those cases would be returning |
Yes, at least if we have proper testing of it .. |
But let's do that in a next PR, going to merge this one already |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
Alright - I'll take a look. I wonder if there's some post-processing in JSON that is masking that... I'll take care of the backport as well. Thanks for merging |
…in JSON IO tests (cherry picked from commit 9bc88c7)
Manual backport -> #60327 |
No description provided.