Skip to content

Commit 63a37b1

Browse files
authored
Add Column Name to the Error Message in StatsAggregator (#2190)
<!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> Closes #2017 # Rationale for this change Include the column name in the error message to make it more descriptive. # Are these changes tested? # Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. -->
1 parent 7a99eb4 commit 63a37b1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pyiceberg/io/pyarrow.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,9 +2410,12 @@ def data_file_statistics_from_parquet_metadata(
24102410
continue
24112411

24122412
if field_id not in col_aggs:
2413-
col_aggs[field_id] = StatsAggregator(
2414-
stats_col.iceberg_type, statistics.physical_type, stats_col.mode.length
2415-
)
2413+
try:
2414+
col_aggs[field_id] = StatsAggregator(
2415+
stats_col.iceberg_type, statistics.physical_type, stats_col.mode.length
2416+
)
2417+
except ValueError as e:
2418+
raise ValueError(f"{e} for column '{stats_col.column_name}'") from e
24162419

24172420
if isinstance(stats_col.iceberg_type, DecimalType) and statistics.physical_type != "FIXED_LEN_BYTE_ARRAY":
24182421
scale = stats_col.iceberg_type.scale

0 commit comments

Comments
 (0)