ndrluis commented on code in PR #1066: URL: https://github.com/apache/iceberg-python/pull/1066#discussion_r1719186698
########## pyiceberg/table/__init__.py: ########## @@ -4393,12 +4397,12 @@ def _readable_metrics_struct(bound_type: PrimitiveType) -> pa.StructType: "spec_id": data_file.spec_id, "record_count": data_file.record_count, "file_size_in_bytes": data_file.file_size_in_bytes, - "column_sizes": dict(data_file.column_sizes), - "value_counts": dict(data_file.value_counts), - "null_value_counts": dict(data_file.null_value_counts), - "nan_value_counts": dict(data_file.nan_value_counts), - "lower_bounds": dict(data_file.lower_bounds), - "upper_bounds": dict(data_file.upper_bounds), + "column_sizes": dict(data_file.column_sizes) if data_file.column_sizes is not None else None, Review Comment: I believe that using `dict(data_file.column_sizes or {})` will achieve the same behavior without the need for an if statement. What do you think? -- 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