The GitHub Actions job "Python Build Release Candidate" on 
iceberg-python.git/pyiceberg-0.11.1rc1 has failed.
Run started by GitHub user kevinjqliu (triggered by kevinjqliu).

Head commit for run:
c1ac2315c138cebec6e8fefcf15475c51a31ab46 / shiwk <[email protected]>
fix: add Field alias for SetPartitionStatisticsUpdate (#3035)

<!--
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 #${GITHUB_ISSUE_ID} -->

# Rationale for this change

Add `Field(alias="partition-statistics")` to
`SetPartitionStatisticsUpdate.partition_statistics` to ensure correct
serialization/deserialization with the hyphenated key format.

## Problem
The `partition_statistics` field was missing an explicit `Field` alias,
which means:
- When serializing with `model_dump(by_alias=True)`, it would use the
Python attribute name `partition_statistics` (with underscore) instead
of the Iceberg specification format `partition-statistics` (with hyphen)
- This causes incompatibility with the Iceberg table metadata format
specification

## Solution
Added `Field(alias="partition-statistics")` to ensure:
- Proper serialization to JSON/dict using hyphenated key names that
comply with Iceberg spec
- Correct deserialization when parsing external metadata with hyphenated
keys
- Consistency with other similar fields in the codebase (e.g.,
`snapshot_ids` with alias `snapshot-ids`)

## Are these changes tested?

Yes. Added verification in `test_set_partition_statistics_update()` to
validate that:
1. The update object serializes to JSON with the correct
`"partition-statistics"` key
2. The key is present in the serialized output

## Are there any user-facing changes?

No. This is an internal fix to ensure metadata serialization format
compliance. The change is transparent to users and improves
interoperability with the Iceberg specification.

<!-- In the case of user-facing changes, please add the changelog label.
-->

Report URL: https://github.com/apache/iceberg-python/actions/runs/22452491169

With regards,
GitHub Actions via GitBox

Reply via email to