Open
Description
@pytest.mark.parametrize("bigNum", [sys.maxsize + 1, -(sys.maxsize + 2)])
# @pytest.mark.xfail(sys.maxsize == 2**32, reason="")
def test_read_json_large_numbers(self, bigNum):
# GH20599
series = Series(bigNum, dtype=object, index=["articleId"])
json = '{"articleId":' + str(bigNum) + "}"
with pytest.raises(ValueError):
json = StringIO(json)
result = read_json(json)
tm.assert_series_equal(series, result)
df = DataFrame(bigNum, dtype=object, index=["articleId"], columns=[0])
json = '{"0":{"articleId":' + str(bigNum) + "}}"
with pytest.raises(ValueError):
json = StringIO(json)
result = read_json(json)
> tm.assert_frame_equal(df, result)
E AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="0") are different
E
E Attribute "dtype" are different
E [left]: object
E [right]: int64
We have
-> tm.assert_frame_equal(df, result)
(Pdb) result
0
articleId 1
(Pdb) df
0
articleId 18446744073709551617