pratyushadk commented on code in PR #50907:
URL: https://github.com/apache/arrow/pull/50907#discussion_r3846773028
##########
python/pyarrow/tests/test_sparse_tensor.py:
##########
@@ -254,6 +254,26 @@ def test_sparse_csr_matrix_from_dense(dtype_str,
arrow_type):
assert np.array_equal(indices, result_indices)
[email protected](not csr_matrix, reason="requires scipy")
[email protected]('pa_class', [
+ pa.SparseCSRMatrix,
+ pa.SparseCSCMatrix,
+])
Review Comment:
I added `csr_array` and `csc_array` coverage by checking the type returned
from `to_scipy()` for both CSR and CSC.
For the 1D dense-input reference, I retained `csr_matrix` and `csc_matrix`:
`csc_array` does not accept 1D input (`ValueError: CSC arrays don't support 1D
input. Use 2D`), while `csr_array` preserves it as 1D `(n,)`. The matrix
classes normalize the input to `(1, n)`, matching Arrow's result. I also
removed the redundant `from_dense_numpy` check.
--
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]