yayaha opened a new pull request, #4320:
URL: https://github.com/apache/iceberg-python/pull/4320

   # Rationale for this change
   
   The REST spec adds an optional `labels` field to `LoadTableResult` and 
`LoadViewResult` 
([spec](https://github.com/apache/iceberg/blob/3f5097b93361161ce415aca38a73c09c5e3a66a4/open-api/rest-catalog-open-api.yaml#L4201-L4219),
 apache/iceberg#15750). Labels are metadata from the catalog, such as ownership 
or classification. They are not table state. PyIceberg drops the field today.
   
   This PR is part 1 of 2. It follows the Java read path (apache/iceberg#18045):
   
   - Adds the `Labels` and `FieldLabel` models in `pyiceberg/table/labels.py`.
   - Parses `labels` on `TableResponse` and `ViewResponse`.
   
   Parsing is the same as in Java. A `null` value for `labels`, 
`object-labels`, or `fields` reads as empty. A field entry without `field-id` 
or `labels` is rejected. `Labels.is_empty()` is the same as `Labels.isEmpty()`. 
Differences from Java:
   
   - There is no shared `Labels.EMPTY`, because the models hold mutable dicts.
   - A `labels` value that is not an object is rejected. Java reads it as empty.
   
   ## Are these changes tested?
   
   Yes. `tests/table/test_labels.py` tests the parsing and the rejected field 
entries. `test_load_responses_parse_labels` tests `TableResponse` and 
`ViewResponse` with labels, without labels, and with `labels: null`.
   
   ## Are there any user-facing changes?
   
   No. Part 2 adds `Table.labels`.
   
   AI disclosure: This pull request and its description were written by Claude.
   


-- 
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]

Reply via email to