@@ -2082,6 +2082,8 @@ def __init__(self, iceberg_type: PrimitiveType, physical_type_string: str, trunc
20822082 self .trunc_length = trunc_length
20832083
20842084 expected_physical_type = _primitive_to_physical (iceberg_type )
2085+
2086+ # TODO: Refactor to use promotion logic
20852087 if expected_physical_type != physical_type_string :
20862088 # Allow promotable physical types
20872089 # INT32 -> INT64 and FLOAT -> DOUBLE are safe type casts
@@ -2509,12 +2511,16 @@ def data_file_statistics_from_parquet_metadata(
25092511
25102512 if isinstance (stats_col .iceberg_type , DecimalType ) and statistics .physical_type != "FIXED_LEN_BYTE_ARRAY" :
25112513 scale = stats_col .iceberg_type .scale
2512- col_aggs [field_id ].update_min (
2513- unscaled_to_decimal (statistics .min_raw , scale )
2514- ) if statistics .min_raw is not None else None
2515- col_aggs [field_id ].update_max (
2516- unscaled_to_decimal (statistics .max_raw , scale )
2517- ) if statistics .max_raw is not None else None
2514+ (
2515+ col_aggs [field_id ].update_min (unscaled_to_decimal (statistics .min_raw , scale ))
2516+ if statistics .min_raw is not None
2517+ else None
2518+ )
2519+ (
2520+ col_aggs [field_id ].update_max (unscaled_to_decimal (statistics .max_raw , scale ))
2521+ if statistics .max_raw is not None
2522+ else None
2523+ )
25182524 else :
25192525 col_aggs [field_id ].update_min (statistics .min )
25202526 col_aggs [field_id ].update_max (statistics .max )
0 commit comments