rok commented on code in PR #46423:
URL: https://github.com/apache/arrow/pull/46423#discussion_r2183311621
##########
python/pyarrow/tensor.pxi:
##########
@@ -732,19 +733,19 @@ shape: {self.shape}"""
@staticmethod
def from_scipy(obj, dim_names=None):
"""
- Convert scipy.sparse.csr_matrix to arrow::SparseCSRMatrix.
+ Convert scipy.sparse.csr_array or scipy.sparse.csr_matrix to
arrow::SparseCSRMatrix.
Parameters
----------
- obj : scipy.sparse.csr_matrix
+ obj : scipy.sparse.csr_array or scipy.sparse.csr_matrix
The scipy matrix that should be converted.
dim_names : list, optional
Names of the dimensions.
"""
import scipy.sparse
- if not isinstance(obj, scipy.sparse.csr_matrix):
+ if not (isinstance(obj, scipy.sparse.csr_array) or isinstance(obj,
scipy.sparse.csr_matrix)):
Review Comment:
Done
##########
python/pyarrow/tensor.pxi:
##########
@@ -973,19 +974,19 @@ shape: {self.shape}"""
@staticmethod
def from_scipy(obj, dim_names=None):
"""
- Convert scipy.sparse.csc_matrix to arrow::SparseCSCMatrix
+ Convert scipy.sparse.csc_array or scipy.sparse.csc_matrix to
arrow::SparseCSCMatrix
Parameters
----------
- obj : scipy.sparse.csc_matrix
+ obj : scipy.sparse.csc_array or scipy.sparse.csc_matrix
The scipy matrix that should be converted.
dim_names : list, optional
Names of the dimensions.
"""
import scipy.sparse
- if not isinstance(obj, scipy.sparse.csc_matrix):
+ if not (isinstance(obj, scipy.sparse.csc_array) or isinstance(obj,
scipy.sparse.csc_matrix)):
Review Comment:
Done.
--
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]