tustvold commented on code in PR #4642:
URL: https://github.com/apache/arrow-rs/pull/4642#discussion_r1284478543


##########
parquet/src/file/statistics.rs:
##########
@@ -119,15 +120,18 @@ macro_rules! statistics_enum_func {
 pub fn from_thrift(
     physical_type: Type,
     thrift_stats: Option<TStatistics>,
-) -> Option<Statistics> {
-    match thrift_stats {
+) -> Result<Option<Statistics>> {
+    Ok(match thrift_stats {
         Some(stats) => {
             // Number of nulls recorded, when it is not available, we just 
mark it as 0.
             let null_count = stats.null_count.unwrap_or(0);
-            assert!(
-                null_count >= 0,
-                "Statistics null count is negative ({null_count})"
-            );
+
+            if null_count < 0 {

Review Comment:
   Another option would be to use try_into()



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

Reply via email to