Skip to content

TST: failing sparse test on the numpy/scipy dev build (Azure) #25652

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

A test started to fail the last hours on the build with numpy/scipy master.
I assume it is related to a recent scipy change, commented about that here: scipy/scipy#9920 (comment)

But it is easy to fix on our side to just update the testing code (the construction of the sparse matrix)

Example log: https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=9238&view=logs&jobId=3a03f79d-0b41-5610-1aa4-b4a014d0bc70

__________________________ TestAccessor.test_from_coo __________________________
[gw0] linux -- Python 3.7.2 /home/vsts/miniconda3/envs/pandas-dev/bin/python

self = <pandas.tests.arrays.sparse.test_array.TestAccessor object at 0x7fa1bf7982b0>

    def test_from_coo(self):
        sparse = pytest.importorskip("scipy.sparse")
    
        row = [0, 3, 1, 0]
        col = [0, 3, 1, 2]
        data = [4, 5, 7, 9]
>       sp_array = sparse.coo_matrix(data, (row, col))

pandas/tests/arrays/sparse/test_array.py:1094: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/pandas-dev/lib/python3.7/site-packages/scipy/sparse/coo.py:187: in __init__
    if check_shape(shape) != self._shape:
../../../miniconda3/envs/pandas-dev/lib/python3.7/site-packages/scipy/sparse/sputils.py:279: in check_shape
    new_shape = tuple(operator.index(arg) for arg in args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

.0 = <tuple_iterator object at 0x7fa1bf7987b8>

>   new_shape = tuple(operator.index(arg) for arg in args)
E   TypeError: 'list' object cannot be interpreted as an integer

Metadata

Metadata

Assignees

No one assigned

    Labels

    SparseSparse Data TypeTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions