Skip to content

TST: Test failure on 32bit for TestSparseGroupBy.test_aggfuncs #23605

Closed
@jschendel

Description

@jschendel

The test_aggfuncs test in /sparse/test_groupby.py is failing on 32bit: https://travis-ci.org/MacPython/pandas-wheels/jobs/451706570#L5281

Specifically, the pytest output:

_______________________ TestSparseGroupBy.test_aggfuncs ________________________
self = <pandas.tests.sparse.test_groupby.TestSparseGroupBy object at 0xde3f08ec>
    def test_aggfuncs(self):
        sparse_grouped = self.sparse.groupby('A')
        dense_grouped = self.dense.groupby('A')
    
        result = sparse_grouped.mean().to_sparse()
        expected = dense_grouped.mean().to_sparse()
    
>       tm.assert_frame_equal(result, expected)
/venv/lib/python3.6/site-packages/pandas/tests/sparse/test_groupby.py:50: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/venv/lib/python3.6/site-packages/pandas/util/testing.py:1185: in assert_extension_array_equal
    assert_numpy_array_equal(left_valid, right_valid)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
left = array([-0.17387645482451206, 0.3414148016424936], dtype=object)
right = array([-0.17387645482451206, 0.3414148016424937], dtype=object)
err_msg = None
    def _raise(left, right, err_msg):
        if err_msg is None:
            if left.shape != right.shape:
                raise_assert_detail(obj, '{obj} shapes are different'
                                    .format(obj=obj), left.shape, right.shape)
    
            diff = 0
            for l, r in zip(left, right):
                # count up differences
                if not array_equivalent(l, r, strict_nan=strict_nan):
                    diff += 1
    
            diff = diff * 100.0 / left.size
            msg = '{obj} values are different ({pct} %)'.format(
                obj=obj, pct=np.round(diff, 5))
>           raise_assert_detail(obj, msg, left, right)
E           AssertionError: numpy array are different
E           
E           numpy array values are different (50.0 %)
E           [left]:  [-0.17387645482451206, 0.3414148016424936]
E           [right]: [-0.17387645482451206, 0.3414148016424937]
/venv/lib/python3.6/site-packages/pandas/util/testing.py:1146: AssertionError

The test in question:

def test_aggfuncs(self):
sparse_grouped = self.sparse.groupby('A')
dense_grouped = self.dense.groupby('A')
result = sparse_grouped.mean().to_sparse()
expected = dense_grouped.mean().to_sparse()

xref #23318 : it looks like this is the pr that caused the change?

cc : @jreback @TomAugspurger @5hirish

Metadata

Metadata

Assignees

No one assigned

    Labels

    32bit32-bit systemsGroupbySparseSparse Data TypeTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions