Skip to content

Commit 5fb276a

Browse files
authored
TST: added test for to_json when called on numbers exceeding the int64 limit (#47589)
* TST: added test for to_json when called on numbers that exceed the int64 limit * TST: removed redundant parametrize wrapper * TST: removed redundant variable declarations
1 parent 37d0194 commit 5fb276a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/io/json/test_pandas.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,3 +1908,13 @@ def test_complex_data_tojson(self, data, expected):
19081908
# GH41174
19091909
result = data.to_json()
19101910
assert result == expected
1911+
1912+
def test_json_uint64(self):
1913+
# GH21073
1914+
expected = (
1915+
'{"columns":["col1"],"index":[0,1],'
1916+
'"data":[[13342205958987758245],[12388075603347835679]]}'
1917+
)
1918+
df = DataFrame(data={"col1": [13342205958987758245, 12388075603347835679]})
1919+
result = df.to_json(orient="split")
1920+
assert result == expected

0 commit comments

Comments
 (0)