wanggy0201 opened a new pull request, #4092: URL: https://github.com/apache/iceberg-python/pull/4092
# Rationale for this change Native writes fail with `Cannot have redundant partitions` when a valid partition spec has more than one field derived from the same source column. That includes a format-v1 spec that keeps retired `void` fields next to an active field, and a spec that applies multiple active transforms, such as year and month, to the same timestamp. `PartitionKey.partition` looked up every field by source ID and required exactly one match. Each supplied `PartitionFieldValue` already names its partition field, so the key now uses that field when building the partition record. Field order, null slots, field IDs, and existing specs are unchanged. ## Are these changes tested? - Six regression cases cover retained `void` fields with null and non-null active values, multiple active transforms, Arrow partition grouping, and a format-v1 Arrow-to-Parquet write with retired fields. - `uv run --extra pyiceberg-core python -m pytest tests/table/test_partition_key.py` passed (6 tests). - Ruff check and format passed on `pyiceberg/partitioning.py` and `tests/table/test_partition_key.py`. ## Are there any user-facing changes? Native writes now succeed for valid partition specs that share a source column across multiple fields. This does not change table metadata. -- 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]
