Skip to content

Commit 492e3e9

Browse files
authored
WIP CI: MacPython failing TestPandasContainer.test_to_json_large_numbers (pandas-dev#35184)
1 parent 08b9c1b commit 492e3e9

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

pandas/tests/io/json/test_pandas.py

+15-6
Original file line numberDiff line numberDiff line change
@@ -1250,23 +1250,32 @@ def test_to_json_large_numbers(self, bigNum):
12501250
json = series.to_json()
12511251
expected = '{"articleId":' + str(bigNum) + "}"
12521252
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) + "}"
12541266
with pytest.raises(ValueError):
12551267
json = StringIO(json)
12561268
result = read_json(json)
12571269
tm.assert_series_equal(series, result)
12581270

12591271
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) + "}}"
12641273
with pytest.raises(ValueError):
12651274
json = StringIO(json)
12661275
result = read_json(json)
12671276
tm.assert_frame_equal(df, result)
12681277

1269-
def test_read_json_large_numbers(self):
1278+
def test_read_json_large_numbers2(self):
12701279
# GH18842
12711280
json = '{"articleId": "1404366058080022500245"}'
12721281
json = StringIO(json)

0 commit comments

Comments
 (0)