Skip to content
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

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

Closed
jorisvandenbossche opened this issue Mar 11, 2019 · 1 comment
Closed
Labels
Sparse Sparse Data Type Testing pandas testing functions or related to the test suite
Milestone

Comments

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Mar 11, 2019

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
@jorisvandenbossche
Copy link
Member Author

On second thought, it was actually our test that was using sparse.coo_matrix(..) incorrectly (and which now started to be validated on the scipy side, which is a good thing :)).
Updated the PR to fix this accordingly: #25653

@jorisvandenbossche jorisvandenbossche added Testing pandas testing functions or related to the test suite Sparse Sparse Data Type labels Mar 11, 2019
@jorisvandenbossche jorisvandenbossche added this to the 0.24.2 milestone Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sparse Sparse Data Type Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

1 participant