kou commented on code in PR #45550:
URL: https://github.com/apache/arrow/pull/45550#discussion_r1968941969
##########
python/pyarrow/array.pxi:
##########
@@ -704,6 +707,95 @@ def _restore_array(data):
return pyarrow_wrap_array(MakeArray(ad))
+cdef class ArrayStatistics(_Weakrefable):
+ """
+ The class for statistics of an array.
+ """
+
+ def __init__(self):
+ raise TypeError("Do not call {}'s constructor directly"
+ .format(self.__class__.__name__))
+
+ cdef void init(self, const shared_ptr[CArrayStatistics]& sp_statistics)
except *:
+ self.sp_statistics = sp_statistics
+
+ def __repr__(self):
+ return ("arrow.ArrayStatistics<null_count={}, distinct_count={}, "
+ "min={}, is_min_exact={}, max={}, is_max_exact={}>"
+ .format(self.null_count, self.distinct_count, self.min,
+ self.is_min_exact, self.max, self.is_max_exact))
+
+ @property
+ def null_count(self):
+ """
+ The number of nulls.
+ """
+ null_count = self.sp_statistics.get().null_count
+ if null_count.has_value():
+ return null_count.value()
+ else:
+ return None
Review Comment:
Thanks! I've added a comment that refers the issue.
--
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]