You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/12 00:42:19 UTC

[GitHub] [arrow] mrkn commented on a change in pull request #7044: ARROW-6485: [Format][C++] Support the format of a COO sparse matrix that has separated row and column indices

mrkn commented on a change in pull request #7044:
URL: https://github.com/apache/arrow/pull/7044#discussion_r438924682



##########
File path: cpp/src/arrow/tensor/util.h
##########
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+namespace arrow {
+namespace internal {
+
+template <typename Int>
+inline char const* ordinal_suffix(const Int n) {

Review comment:
       I used this internal utility function to building error messages.
   An example use case is [here](https://github.com/apache/arrow/pull/7044/files#diff-4ff845cf63a5d797badfaff498817e8eR30-R34).
   
   I believe this file is not a suitable location for this function.
   Where is the best place?  May `util/formatting.h` be a candidate?

##########
File path: python/pyarrow/tests/test_sparse_tensor.py
##########
@@ -189,21 +231,50 @@ def test_sparse_coo_tensor_from_dense(dtype_str, arrow_type):
 
     # Test from numpy array
     sparse_tensor = pa.SparseCOOTensor.from_dense_numpy(array)
-    repr(sparse_tensor)

Review comment:
       @rok I guess this kind of `repr` calls in this file are for debugging and needless, so I removed them.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org