You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/08/17 13:08:36 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #37168: GH-36933: [Python] Pointless ellipsis in array repr

lidavidm commented on code in PR #37168:
URL: https://github.com/apache/arrow/pull/37168#discussion_r1297197438


##########
cpp/src/arrow/pretty_print.cc:
##########
@@ -145,7 +145,8 @@ class ArrayPrinter : public PrettyPrinter {
     int window = is_container ? options_.container_window : options_.window;
     for (int64_t i = 0; i < array.length(); ++i) {
       const bool is_last = (i == array.length() - 1);
-      if ((i >= window) && (i < (array.length() - window))) {

Review Comment:
   I don't think so, because if you have (say) 6 elements with a window of 2, then you'd render 5 of the elements when you only mean to render 4, right?



##########
cpp/src/arrow/pretty_print.cc:
##########
@@ -145,7 +145,8 @@ class ArrayPrinter : public PrettyPrinter {
     int window = is_container ? options_.container_window : options_.window;
     for (int64_t i = 0; i < array.length(); ++i) {
       const bool is_last = (i == array.length() - 1);
-      if ((i >= window) && (i < (array.length() - window))) {

Review Comment:
   That said, we should comment this check to be clear about what it's achieving



-- 
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: github-unsubscribe@arrow.apache.org

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