You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pitrou (via GitHub)" <gi...@apache.org> on 2023/07/12 07:27:28 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #36626: GH-36619: [Python] Parquet statistics string representation misleading

pitrou commented on code in PR #36626:
URL: https://github.com/apache/arrow/pull/36626#discussion_r1260723966


##########
python/pyarrow/_parquet.pyx:
##########
@@ -181,11 +181,11 @@ cdef class Statistics(_Weakrefable):
     def distinct_count(self):
         """
         Distinct number of values in chunk (int).
-
-        If this is not set, will return 0.
         """
-        # This seems to be zero if not set. See: ARROW-11793
-        return self.statistics.get().distinct_count()
+        if self.has_distinct_count:
+            return self.statistics.get().distinct_count()
+        else:
+            return None

Review Comment:
   Should we do the same for `null_count`?



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