File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1168,6 +1168,7 @@ def _try_convert_data(
1168
1168
"""
1169
1169
Try to parse a Series into a column by inferring dtype.
1170
1170
"""
1171
+ org_data = data
1171
1172
# don't try to coerce, unless a force conversion
1172
1173
if use_dtypes :
1173
1174
if not self .dtype :
@@ -1222,7 +1223,7 @@ def _try_convert_data(
1222
1223
if len (data ) and data .dtype in ("float" , "object" ):
1223
1224
# coerce ints if we can
1224
1225
try :
1225
- new_data = data .astype ("int64" )
1226
+ new_data = org_data .astype ("int64" )
1226
1227
if (new_data == data ).all ():
1227
1228
data = new_data
1228
1229
converted = True
Original file line number Diff line number Diff line change @@ -2286,3 +2286,15 @@ def test_read_json_lines_rangeindex():
2286
2286
result = read_json (StringIO (data ), lines = True ).index
2287
2287
expected = RangeIndex (2 )
2288
2288
tm .assert_index_equal (result , expected , exact = True )
2289
+
2290
+
2291
+ def test_large_number ():
2292
+ assert (
2293
+ read_json (
2294
+ StringIO ('["9999999999999999"]' ),
2295
+ orient = "values" ,
2296
+ typ = "series" ,
2297
+ convert_dates = False ,
2298
+ )[0 ]
2299
+ == 9999999999999999
2300
+ )
You can’t perform that action at this time.
0 commit comments