raulcd commented on code in PR #49105:
URL: https://github.com/apache/arrow/pull/49105#discussion_r2759660822
##########
cpp/src/arrow/sparse_tensor.cc:
##########
@@ -405,11 +405,25 @@ SparseCSFIndex::SparseCSFIndex(const
std::vector<std::shared_ptr<Tensor>>& indpt
std::string SparseCSFIndex::ToString() const { return
std::string("SparseCSFIndex"); }
bool SparseCSFIndex::Equals(const SparseCSFIndex& other) const {
+ if (indices().size() != other.indices().size()) {
+ return false;
+ }
+ if (indptr().size() != other.indptr().size()) {
+ return false;
+ }
+ if (axis_order().size() != other.axis_order().size()) {
+ return false;
+ }
+
for (int64_t i = 0; i < static_cast<int64_t>(indices().size()); ++i) {
- if (!indices()[i]->Equals(*other.indices()[i])) return false;
+ if (!indices()[i]->Equals(*other.indices()[i])) {
+ return false;
+ }
}
for (int64_t i = 0; i < static_cast<int64_t>(indptr().size()); ++i) {
- if (!indptr()[i]->Equals(*other.indptr()[i])) return false;
+ if (!indptr()[i]->Equals(*other.indptr()[i])) {
+ return false;
+ }
Review Comment:
Why is this being changed?
##########
cpp/src/arrow/sparse_tensor.cc:
##########
@@ -405,11 +405,25 @@ SparseCSFIndex::SparseCSFIndex(const
std::vector<std::shared_ptr<Tensor>>& indpt
std::string SparseCSFIndex::ToString() const { return
std::string("SparseCSFIndex"); }
bool SparseCSFIndex::Equals(const SparseCSFIndex& other) const {
+ if (indices().size() != other.indices().size()) {
+ return false;
+ }
+ if (indptr().size() != other.indptr().size()) {
+ return false;
+ }
+ if (axis_order().size() != other.axis_order().size()) {
+ return false;
+ }
Review Comment:
Could you explain why is this required?
--
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]