Skip to content

Commit c472a3a

Browse files
DOC/TST: Update tests and docs for np.NA fix
1 parent 715118e commit c472a3a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

doc/source/whatsnew/v1.0.2.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ Fixed regressions
2525
Bug fixes
2626
~~~~~~~~~
2727

28-
**I/O**
28+
I/O
29+
^^^
2930

3031
- Using ``pd.NA`` with :meth:`DataFrame.to_json` now correctly outputs a null value instead of an empty object (:issue:`31615`)
3132

pandas/tests/io/json/test_pandas.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,11 @@ def test_to_s3(self, s3_resource):
16731673
)
16741674

16751675
@pytest.mark.parametrize(
1676-
"dataframe,expected", [(pd.DataFrame([[pd.NA]]), '{"0":{"0":null}}',)],
1676+
"dataframe,expected",
1677+
[
1678+
(pd.DataFrame([[pd.NA]]), '{"0":{"0":null}}',),
1679+
(pd.DataFrame({pd.NA: ["a"]}), '{"<NA>":{"0":"a"}}',),
1680+
],
16771681
)
16781682
def test_json_pandas_na(self, dataframe, expected):
16791683
# GH 31615

0 commit comments

Comments
 (0)