Skip to content

pandas/tests/io/json/test_pandas.py::TestPandasContainer::test_read_json_large_numbers failing for 32-bit system #35279

@TomAugspurger

Description

@TomAugspurger
 @pytest.mark.parametrize("bigNum", [sys.maxsize + 1, -(sys.maxsize + 2)]) # @pytest.mark.xfail(sys.maxsize == 2**32, reason="") def test_read_json_large_numbers(self, bigNum): # GH20599 series = Series(bigNum, dtype=object, index=["articleId"]) json = '{"articleId":' + str(bigNum) + "}" with pytest.raises(ValueError): json = StringIO(json) result = read_json(json) tm.assert_series_equal(series, result) df = DataFrame(bigNum, dtype=object, index=["articleId"], columns=[0]) json = '{"0":{"articleId":' + str(bigNum) + "}}" with pytest.raises(ValueError): json = StringIO(json) result = read_json(json) > tm.assert_frame_equal(df, result) E AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="0") are different E E Attribute "dtype" are different E [left]: object E [right]: int64 

We have

-> tm.assert_frame_equal(df, result) (Pdb) result 0 articleId 1 (Pdb) df 0 articleId 18446744073709551617 

Metadata

Metadata

Assignees

No one assigned

    Labels

    32bit32-bit systemsBugIO JSONread_json, to_json, json_normalize

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions