Fokko commented on code in PR #1902:
URL: https://github.com/apache/iceberg-python/pull/1902#discussion_r2042825738


##########
pyiceberg/table/inspect.py:
##########
@@ -205,9 +205,13 @@ def _readable_metrics_struct(bound_type: PrimitiveType) -> 
pa.StructType:
                             "record_count": entry.data_file.record_count,
                             "file_size_in_bytes": 
entry.data_file.file_size_in_bytes,
                             "column_sizes": dict(entry.data_file.column_sizes),
-                            "value_counts": dict(entry.data_file.value_counts),
-                            "null_value_counts": 
dict(entry.data_file.null_value_counts),
-                            "nan_value_counts": 
dict(entry.data_file.nan_value_counts),
+                            "value_counts": dict(entry.data_file.value_counts) 
if entry.data_file.value_counts else {},
+                            "null_value_counts": 
dict(entry.data_file.null_value_counts)
+                            if entry.data_file.null_value_counts
+                            else {},
+                            "nan_value_counts": 
dict(entry.data_file.nan_value_counts)
+                            if entry.data_file.nan_value_counts
+                            else {},

Review Comment:
   ```suggestion
                               "value_counts": 
dict(entry.data_file.value_counts or {}),
                               "null_value_counts": 
dict(entry.data_file.null_value_counts or {}),
                               "nan_value_counts": 
dict(entry.data_file.nan_value_counts or {}),
   ```



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to