rok commented on code in PR #14378:
URL: https://github.com/apache/arrow/pull/14378#discussion_r995911111
##########
python/pyarrow/tests/test_sparse_tensor.py:
##########
@@ -434,6 +434,21 @@ def test_sparse_coo_tensor_scipy_roundtrip(dtype_str,
arrow_type):
assert sparse_tensor.has_canonical_format
assert out_scipy_matrix.has_canonical_format
+ scipy_matrix = coo_matrix([[0, 0], [0, 0]])
Review Comment:
The reported issue was due to `scipy.coo_matrix` returning a sparse matrix
with a dimension of zero size for an all zeros dense tensor. This is not an
issue if the sparse matrix is created from components. Propose change tests
from dense creation path in Python with `scipy.coo_matrix`, `scipy.csr_matrix`
and `sparse.COO`. It also tests C++ SparseTensor creation from a dense tensor
with one zero-sized dimension for `SparseCOOTensor`, `SparseCSRMatrix`,
`SparseCSRMatrix` and `SparseCSFTensor`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]