@@ -1566,11 +1566,8 @@ def test_from_json_to_json_table_dtypes(self):
1566
1566
result = read_json (StringIO (dfjson ), orient = "table" )
1567
1567
tm .assert_frame_equal (result , expected )
1568
1568
1569
- # TODO: We are casting to string which coerces None to NaN before casting back
1570
- # to object, ending up with incorrect na values
1571
- @pytest .mark .xfail (using_string_dtype (), reason = "incorrect na conversion" )
1572
1569
@pytest .mark .parametrize ("orient" , ["split" , "records" , "index" , "columns" ])
1573
- def test_to_json_from_json_columns_dtypes (self , orient ):
1570
+ def test_to_json_from_json_columns_dtypes (self , orient , using_infer_string ):
1574
1571
# GH21892 GH33205
1575
1572
expected = DataFrame .from_dict (
1576
1573
{
@@ -1591,6 +1588,11 @@ def test_to_json_from_json_columns_dtypes(self, orient):
1591
1588
with tm .assert_produces_warning (FutureWarning , match = msg ):
1592
1589
dfjson = expected .to_json (orient = orient )
1593
1590
1591
+ if using_infer_string :
1592
+ # When this is read back in it is inferred to "str" dtype which
1593
+ # uses NaN instead of None.
1594
+ expected .loc [0 , "Object" ] = np .nan
1595
+
1594
1596
result = read_json (
1595
1597
StringIO (dfjson ),
1596
1598
orient = orient ,
@@ -1849,11 +1851,11 @@ def test_to_json_indent(self, indent):
1849
1851
1850
1852
assert result == expected
1851
1853
1852
- @pytest .mark .skipif (
1853
- using_string_dtype (),
1854
- reason = "Adjust expected when infer_string is default, no bug here, "
1855
- "just a complicated parametrization" ,
1856
- )
1854
+ # @pytest.mark.skipif(
1855
+ # using_string_dtype(),
1856
+ # reason="Adjust expected when infer_string is default, no bug here, "
1857
+ # "just a complicated parametrization",
1858
+ # )
1857
1859
@pytest .mark .parametrize (
1858
1860
"orient,expected" ,
1859
1861
[
0 commit comments