File tree 3 files changed +15
-1
lines changed
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 630
630
- Bug in :meth: `read_csv ` where the order of the ``na_values `` makes an inconsistency when ``na_values `` is a list non-string values. (:issue: `59303 `)
631
631
- Bug in :meth: `read_excel ` raising ``ValueError `` when passing array of boolean values when ``dtype="boolean" ``. (:issue: `58159 `)
632
632
- Bug in :meth: `read_json ` not validating the ``typ `` argument to not be exactly ``"frame" `` or ``"series" `` (:issue: `59124 `)
633
+ - Bug in :meth: `read_json ` where extreme value integers in string format were incorrectly parsed as a different integer number (:issue: `20608 `)
633
634
- Bug in :meth: `read_stata ` raising ``KeyError `` when input file is stored in big-endian format and contains strL data. (:issue: `58638 `)
634
635
- Bug in :meth: `read_stata ` where extreme value integers were incorrectly interpreted as missing for format versions 111 and prior (:issue: `58130 `)
635
636
- Bug in :meth: `read_stata ` where the missing code for double was not recognised for format versions 105 and prior (:issue: `58149 `)
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
+ # GH#20608
2293
+ result = read_json (
2294
+ StringIO ('["9999999999999999"]' ),
2295
+ orient = "values" ,
2296
+ typ = "series" ,
2297
+ convert_dates = False ,
2298
+ )
2299
+ expected = Series ([9999999999999999 ])
2300
+ tm .assert_series_equal (result , expected )
You can’t perform that action at this time.
0 commit comments