Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pandas/io/json/_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@ def _try_convert_data(
"""
Try to parse a Series into a column by inferring dtype.
"""
backup_data = data
# don't try to coerce, unless a force conversion
if use_dtypes:
if not self.dtype:
Expand Down Expand Up @@ -1221,7 +1222,7 @@ def _try_convert_data(
if len(data) and data.dtype in ("float", "object"):
# coerce ints if we can
try:
new_data = data.astype("int64")
new_data = backup_data.astype("int64")
if (new_data == data).all():
data = new_data
converted = True
Expand Down
6 changes: 6 additions & 0 deletions pandas/tests/io/json/test_large_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from io import StringIO
import pytest
import pandas as pd

def test_large_number():
assert pd.read_json(StringIO('["9999999999999999"]'),orient="values",typ="series",convert_dates=False)[0] == 9999999999999999