Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 818964 - dev-python/pandas-1.3.4: fails test_float_precision_options and test_subtype_integer_errors tests on arm
Summary: dev-python/pandas-1.3.4: fails test_float_precision_options and test_subtype_...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks: 915000
  Show dependency tree
 
Reported: 2021-10-20 05:34 UTC by Sam James
Modified: 2023-10-01 06:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-20 05:34:40 UTC
Far more failed (not sure if it was a fluke or not) with 1.3.3.

The first two I think we can live with given they're natural as a result of FP / 32-bit rches,
but the last one is more concerning.

Dakon reported the same thing(?) in bug 809854 for sparc.

Looks almost the same as https://github.com/pandas-dev/pandas/issues/36579.

----

FAILED pandas/tests/io/parser/test_c_parser_only.py::test_float_precision_options[c_high] - assert 243.164 == 243.16400000000002
FAILED pandas/tests/io/parser/test_c_parser_only.py::test_float_precision_options[c_low] - assert 243.164 == 243.16400000000002
FAILED pandas/tests/indexes/interval/test_astype.py::TestFloatSubtype::test_subtype_integer_errors - Failed: DID NOT RAISE <class 'TypeError'>
===================================================== 3 failed, 170235 passed, 9866 skipped, 873 xfailed, 6 xpassed, 866 warnings in 2675.34s (0:44:35) ======================================================
 * pytest failed with python3.8
 * ERROR: dev-python/pandas-1.3.4::gentoo failed (test phase):
 *   Failed to run 'epytest pandas --skip-slow --skip-network --deselect pandas/tests/window/test_rolling.py::test_rolling_var_numerical_issues --deselect pandas/tests/base/test_misc.py::test_memory_usage[series-with-empty-index] --deselect pandas/tests/tools/test_to_datetime.py::TestToDatetime::test_to_datetime_tz_psycopg2 --deselect pandas/tests/io/xml/test_xml.py::test_wrong_url --deselect pandas/tests/io/test_fsspec.py::test_read_csv --deselect pandas/tests/io/test_fsspec.py::test_markdown_options -m not single -n 6'

----

================================================================================================== FAILURES ==================================================================================================
____________________________________________________________________________________ test_float_precision_options[c_high] ____________________________________________________________________________________
[gw4] linux -- Python 3.8.12 /usr/bin/python3.8

c_parser_only = <pandas.tests.io.parser.conftest.CParserHighMemory object at 0xeb8c36b8>

    def test_float_precision_options(c_parser_only):
        # GH 17154, 36228
        parser = c_parser_only
        s = "foo\n243.164\n"
        df = parser.read_csv(StringIO(s))
        df2 = parser.read_csv(StringIO(s), float_precision="high")

        tm.assert_frame_equal(df, df2)

        df3 = parser.read_csv(StringIO(s), float_precision="legacy")

        if IS64:
            assert not df.iloc[0, 0] == df3.iloc[0, 0]
        else:
>           assert df.iloc[0, 0] == df3.iloc[0, 0]
E           assert 243.164 == 243.16400000000002
E             +243.164
E             -243.16400000000002

c_parser_only = <pandas.tests.io.parser.conftest.CParserHighMemory object at 0xeb8c36b8>
df         =        foo
0  243.164
df2        =        foo
0  243.164
df3        =        foo
0  243.164
parser     = <pandas.tests.io.parser.conftest.CParserHighMemory object at 0xeb8c36b8>
s          = 'foo\n243.164\n'

pandas/tests/io/parser/test_c_parser_only.py:679: AssertionError

----

____________________________________________________________________________________ test_float_precision_options[c_low] _____________________________________________________________________________________
[gw4] linux -- Python 3.8.12 /usr/bin/python3.8

c_parser_only = <pandas.tests.io.parser.conftest.CParserLowMemory object at 0xeb8c3700>

    def test_float_precision_options(c_parser_only):
        # GH 17154, 36228
        parser = c_parser_only
        s = "foo\n243.164\n"
        df = parser.read_csv(StringIO(s))
        df2 = parser.read_csv(StringIO(s), float_precision="high")

        tm.assert_frame_equal(df, df2)

        df3 = parser.read_csv(StringIO(s), float_precision="legacy")

        if IS64:
            assert not df.iloc[0, 0] == df3.iloc[0, 0]
        else:
>           assert df.iloc[0, 0] == df3.iloc[0, 0]
E           assert 243.164 == 243.16400000000002
E             +243.164
E             -243.16400000000002

c_parser_only = <pandas.tests.io.parser.conftest.CParserLowMemory object at 0xeb8c3700>
df         =        foo
0  243.164
df2        =        foo
0  243.164
df3        =        foo
0  243.164
parser     = <pandas.tests.io.parser.conftest.CParserLowMemory object at 0xeb8c3700>
s          = 'foo\n243.164\n'

pandas/tests/io/parser/test_c_parser_only.py:679: AssertionError

----

pandas/tests/io/parser/test_c_parser_only.py:679: AssertionError
________________________________________________________________________________ TestFloatSubtype.test_subtype_integer_errors ________________________________________________________________________________
[gw3] linux -- Python 3.8.12 /usr/bin/python3.8

self = <pandas.tests.indexes.interval.test_astype.TestFloatSubtype object at 0xadc93208>

    @pytest.mark.xfail(is_platform_arm(), reason="GH 41740")
    def test_subtype_integer_errors(self):
        # float64 -> uint64 fails with negative values
        index = interval_range(-10.0, 10.0)
        dtype = IntervalDtype("uint64", "right")
        msg = re.escape(
            "Cannot convert interval[float64, right] to interval[uint64, right]; "
            "subtypes are incompatible"
        )
        with pytest.raises(TypeError, match=msg):
>           index.astype(dtype)
E           Failed: DID NOT RAISE <class 'TypeError'>

dtype      = interval[uint64, right]
index      = IntervalIndex([(-10.0, -9.0], (-9.0, -8.0], (-8.0, -7.0], (-7.0, -6.0], (-6.0, -5.0] ... (5.0, 6.0], (6.0, 7.0], (7.0, 8.0], (8.0, 9.0], (9.0, 10.0]], dtype='interval[float64, right]')
msg        = ('Cannot\\ convert\\ interval\\[float64,\\ right\\]\\ to\\ '
 'interval\\[uint64,\\ right\\];\\ subtypes\\ are\\ incompatible')
self       = <pandas.tests.indexes.interval.test_astype.TestFloatSubtype object at 0xadc93208>

pandas/tests/indexes/interval/test_astype.py:183: Failed
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-20 05:38:27 UTC
The build.log is too big to upload to BZ even (aggressively) compressed, so here it is: https://dev.gentoo.org/~sam/bugs/gentoo/pandas-1.3.4-bug818964-arm.log.bz2.

But this is quite interesting. For the test I'm concerned about (test_subtype_integer_errors), it's meant to be skipped on arm: https://github.com/pandas-dev/pandas/blob/44237a5841a77e48e004e9fa1e705c51a88633e2/pandas/tests/indexes/interval/test_astype.py#L173.

But at least in an arm32 chroot ("armv8l") on arm64, I get:

>>> import platform
>>> platform.machine()
'armv8l'

And I'm not sure that the upstream check for 'arm64', 'aarch64' will cover real arm32 either. So I'll poke at that.
Comment 2 Larry the Git Cow gentoo-dev 2021-10-29 16:59:45 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45d65df5773c2bcaf1241e5c0881c7308d9c6740

commit 45d65df5773c2bcaf1241e5c0881c7308d9c6740
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-10-29 16:59:28 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-10-29 16:59:28 +0000

    dev-python/pandas: fix detecting 32-bit arm (for skipping some tests)
    
    Bug: https://bugs.gentoo.org/818964
    Signed-off-by: Sam James <sam@gentoo.org>

 .../pandas/files/pandas-1.3.4-arm-tests.patch       | 21 +++++++++++++++++++++
 dev-python/pandas/pandas-1.3.4.ebuild               |  5 +++++
 2 files changed, 26 insertions(+)