@@ -1250,23 +1250,32 @@ def test_to_json_large_numbers(self, bigNum):
1250
1250
json = series .to_json ()
1251
1251
expected = '{"articleId":' + str (bigNum ) + "}"
1252
1252
assert json == expected
1253
- # GH 20599
1253
+
1254
+ df = DataFrame (bigNum , dtype = object , index = ["articleId" ], columns = [0 ])
1255
+ json = df .to_json ()
1256
+ expected = '{"0":{"articleId":' + str (bigNum ) + "}}"
1257
+ assert json == expected
1258
+
1259
+ @pytest .mark .parametrize ("bigNum" , [sys .maxsize + 1 , - (sys .maxsize + 2 )])
1260
+ @pytest .mark .skipif (sys .maxsize <= 2 ** 32 , reason = "GH-35279" )
1261
+ def test_read_json_large_numbers (self , bigNum ):
1262
+ # GH20599
1263
+
1264
+ series = Series (bigNum , dtype = object , index = ["articleId" ])
1265
+ json = '{"articleId":' + str (bigNum ) + "}"
1254
1266
with pytest .raises (ValueError ):
1255
1267
json = StringIO (json )
1256
1268
result = read_json (json )
1257
1269
tm .assert_series_equal (series , result )
1258
1270
1259
1271
df = DataFrame (bigNum , dtype = object , index = ["articleId" ], columns = [0 ])
1260
- json = df .to_json ()
1261
- expected = '{"0":{"articleId":' + str (bigNum ) + "}}"
1262
- assert json == expected
1263
- # GH 20599
1272
+ json = '{"0":{"articleId":' + str (bigNum ) + "}}"
1264
1273
with pytest .raises (ValueError ):
1265
1274
json = StringIO (json )
1266
1275
result = read_json (json )
1267
1276
tm .assert_frame_equal (df , result )
1268
1277
1269
- def test_read_json_large_numbers (self ):
1278
+ def test_read_json_large_numbers2 (self ):
1270
1279
# GH18842
1271
1280
json = '{"articleId": "1404366058080022500245"}'
1272
1281
json = StringIO (json )
0 commit comments