Skip to content

CI: MacPython failing TestPandasContainer.test_to_json_large_numbers #35147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TomAugspurger opened this issue Jul 6, 2020 · 4 comments · Fixed by #35184
Closed

CI: MacPython failing TestPandasContainer.test_to_json_large_numbers #35147

TomAugspurger opened this issue Jul 6, 2020 · 4 comments · Fixed by #35184
Assignees
Labels
32bit 32-bit systems CI Continuous Integration
Milestone

Comments

@TomAugspurger
Copy link
Contributor

_________ 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.

@TomAugspurger TomAugspurger added Bug Needs Triage Issue that has not been reviewed by a pandas team member 32bit 32-bit systems CI Continuous Integration and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jul 6, 2020
@TomAugspurger TomAugspurger added this to the 1.1 milestone Jul 6, 2020
@arw2019
Copy link
Member

arw2019 commented Jul 6, 2020

take

@WillAyd
Copy link
Member

WillAyd commented Jul 8, 2020

This is on a 32 bit platform right? @arw2019 I think can just change the parametrization to be 2 ** 64 and -(2 ** 64 + 1) instead

@WillAyd
Copy link
Member

WillAyd commented Jul 8, 2020

Or maybe better just remove the pytest.raises pieces as it isn't really relevant to the previous change you made, rather trying to be "forward-looking" on the next fix

@arw2019
Copy link
Member

arw2019 commented Jul 8, 2020

Makes sense to remove this pieces (and in #34984 we test the round-trip when that's fixed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
32bit 32-bit systems CI Continuous Integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants