Skip to content

Commit

Permalink
test for bug #46627
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed May 31, 2022
1 parent 679053c commit d04ec08
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pandas/tests/io/json/test_pandas.py
Expand Up @@ -1326,6 +1326,16 @@ def test_read_json_large_numbers2(self):
expected = DataFrame(1.404366e21, index=["articleId"], columns=[0])
tm.assert_frame_equal(result, expected)

def test_read_json_nans(self, nulls_fixture, request):
# GH 46627
json = StringIO('[NaN, {}, null, 1]')
result = read_json(json)
assert result.iloc[0, 0] is not None # used to return None here
assert np.isnan(result.iloc[0, 0])
assert result.iloc[1, 0] == {}
assert result.iloc[2, 0] is None
assert result.iloc[3, 0] == 1

def test_to_jsonl(self):
# GH9180
df = DataFrame([[1, 2], [1, 2]], columns=["a", "b"])
Expand Down

0 comments on commit d04ec08

Please sign in to comment.