rok commented on issue #47613:
URL: https://github.com/apache/arrow/issues/47613#issuecomment-3318790245
That seems like the thing to do. Something like this would be needed for
enforcement:
```diff
diff --git i/cpp/src/arrow/sparse_tensor.cc w/cpp/src/arrow/sparse_tensor.cc
index b84070b3d2..9e191ef794 100644
--- i/cpp/src/arrow/sparse_tensor.cc
+++ w/cpp/src/arrow/sparse_tensor.cc
@@ -397,6 +397,12 @@ SparseCSFIndex::SparseCSFIndex(const
std::vector<std::shared_ptr<Tensor>>& indpt
const std::vector<std::shared_ptr<Tensor>>&
indices,
const std::vector<int64_t>& axis_order)
: SparseIndexBase(), indptr_(indptr), indices_(indices),
axis_order_(axis_order) {
+ for (const auto & tensor : indptr_) {
+ ARROW_CHECK_EQ(indptr_.front()->type(), tensor->type());
+ }
+ for (const auto & tensor : indices_) {
+ ARROW_CHECK_EQ(indices_.front()->type(), tensor->type());
+ }
ARROW_CHECK_OK(CheckSparseCSFIndexValidity(indptr_.front()->type(),
indices_.front()->type(),
indptr_.size(),
indices_.size(),
axis_order_.size()));
```
--
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]