Copilot commented on code in PR #4083:
URL: https://github.com/apache/iceberg-python/pull/4083#discussion_r4200704841
##########
pyiceberg/io/pyarrow.py:
##########
@@ -1641,9 +1641,7 @@ def _get_column_projection_values(
for field_id in project_schema_diff:
for partition_field in partition_spec.fields_by_source_id(field_id):
if isinstance(partition_field.transform, IdentityTransform):
- partition_value =
accessors[partition_field.field_id].get(file.partition)
- if partition_value is not None:
- projected_missing_fields[field_id] = partition_value
+ projected_missing_fields[field_id] =
accessors[partition_field.field_id].get(file.partition)
Review Comment:
This still misses filter-only partition columns.
`_get_column_projection_values` derives candidates solely from
`projected_schema.field_ids`, so a scan selecting only `other_field` and
filtering with `IsNull("partition_col")` never records this explicit null;
`_ColumnNameTranslator` then falls back to the non-null `initial_default` and
incorrectly removes every row. Include the union of output and filter field IDs
(the caller's `projected_field_ids`) when computing missing projected values,
and cover the partial-projection case described in #4082.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]