Skip to content

CI: MacPython failing TestPandasContainer.test_to_json_large_numbers  #35147

Closed
@TomAugspurger

Description

@TomAugspurger
_________ TestPandasContainer.test_to_json_large_numbers[2147483648] __________
[gw0] win32 -- Python 3.7.7 D:\a\1\s\test_venv\Scripts\python.exe

self = <pandas.tests.io.json.test_pandas.TestPandasContainer object at 0x2C6E2A70>
bigNum = 2147483648

    @pytest.mark.parametrize("bigNum", [sys.maxsize + 1, -(sys.maxsize + 2)])
    def test_to_json_large_numbers(self, bigNum):
        # GH34473
        series = Series(bigNum, dtype=object, index=["articleId"])
        json = series.to_json()
        expected = '{"articleId":' + str(bigNum) + "}"
        assert json == expected
        # GH 20599
        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 = df.to_json()
        expected = '{"0":{"articleId":' + str(bigNum) + "}}"
        assert json == expected
        # GH 20599
        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

https://dev.azure.com/pandas-dev/pandas-wheels/_build/results?buildId=38672&view=logs&j=c0130b29-789d-5a3c-6978-10796a508a7f&t=e120bc6c-1f5e-5a41-8f0a-1d992cd2fbfb

xref #34473.

cc @arw2019.

Metadata

Metadata

Assignees

Labels

32bit32-bit systemsCIContinuous Integration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions