You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "james5418 (via GitHub)" <gi...@apache.org> on 2025/07/09 06:44:21 UTC
[PR] Add Column Name to the Error Message in StatsAggregator [iceberg-python]
james5418 opened a new pull request, #2190:
URL: https://github.com/apache/iceberg-python/pull/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. -->
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Add Column Name to the Error Message in StatsAggregator [iceberg-python]
Posted by "james5418 (via GitHub)" <gi...@apache.org>.
james5418 commented on code in PR #2190:
URL: https://github.com/apache/iceberg-python/pull/2190#discussion_r2217988988
##########
pyiceberg/io/pyarrow.py:
##########
@@ -2405,7 +2407,7 @@ def data_file_statistics_from_parquet_metadata(
if field_id not in col_aggs:
col_aggs[field_id] = StatsAggregator(
- stats_col.iceberg_type, statistics.physical_type, stats_col.mode.length
+ stats_col.iceberg_type, statistics.physical_type, stats_col.mode.length, stats_col.column_name
Review Comment:
Makes sense. I’ll update the PR to follow this approach. Thanks!
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Add Column Name to the Error Message in StatsAggregator [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on code in PR #2190:
URL: https://github.com/apache/iceberg-python/pull/2190#discussion_r2216960396
##########
pyiceberg/io/pyarrow.py:
##########
@@ -1981,11 +1981,13 @@ def visit_unknown(self, unknown_type: UnknownType) -> str:
class StatsAggregator:
current_min: Any
current_max: Any
+ column_name: str
trunc_length: Optional[int]
- def __init__(self, iceberg_type: PrimitiveType, physical_type_string: str, trunc_length: Optional[int] = None) -> None:
+ def __init__(self, iceberg_type: PrimitiveType, physical_type_string: str, column_name: str, trunc_length: Optional[int] = None) -> None:
Review Comment:
i think this is a backwards incompatible change...
maybe we can make column_name optional and in the last position so that its backwards compatible..
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Add Column Name to the Error Message in StatsAggregator [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on code in PR #2190:
URL: https://github.com/apache/iceberg-python/pull/2190#discussion_r2217396095
##########
pyiceberg/io/pyarrow.py:
##########
@@ -2405,7 +2407,7 @@ def data_file_statistics_from_parquet_metadata(
if field_id not in col_aggs:
col_aggs[field_id] = StatsAggregator(
- stats_col.iceberg_type, statistics.physical_type, stats_col.mode.length
+ stats_col.iceberg_type, statistics.physical_type, stats_col.mode.length, stats_col.column_name
Review Comment:
I see that `StatsAggregator` is only used here. WDYT of this approach?
```
try:
col_aggs[field_id] = StatsAggregator(
stats_col.iceberg_type, statistics.physical_type, stats_col.mode.length
)
except ValueError as e:
raise ValueError(f"{e} for column '{stats_col.column_name}'") from e
```
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Add Column Name to the Error Message in StatsAggregator [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on PR #2190:
URL: https://github.com/apache/iceberg-python/pull/2190#issuecomment-3092484992
could you also run `make lint` locally?
```
ruff format..............................................................Failed
- hook id: ruff-format
- files were modified by this hook
1 file reformatted, 156 files left unchanged
```
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] Add Column Name to the Error Message in StatsAggregator [iceberg-python]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu merged PR #2190:
URL: https://github.com/apache/iceberg-python/pull/2190
--
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-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org