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

   > [!NOTE]
   > 🤖 `claude-opus-5-5` on behalf of Prateek
   
   # Rationale for this change
   
   When a table is created from a PyArrow schema, column descriptions come from 
the `doc` key in each field's metadata:
   
   ```python
   # pyiceberg/io/pyarrow.py
   PYARROW_FIELD_DOC_KEY = b"doc"
   ```
   
   The docs don't mention this key. A description stored under another key, 
such as `description`, is not used, and there is no error, so the table ends up 
with no column descriptions. I ran into this writing a table with a few hundred 
described columns to a REST catalog and found the key by reading 
`pyiceberg/io/pyarrow.py`.
   
   This adds a description to one field in the "create a table using a pyarrow 
schema" example, and a short paragraph on the key, including that 
`union_by_name` reads it too and that reading a table back into PyArrow sets it.
   
   ## Are these changes tested?
   
   Docs only. I checked each statement against a local `SqlCatalog`: 
`create_table` with `doc` stores the description in the table metadata and with 
`description` stores none, `union_by_name` adds a new column's description, and 
`scan().to_arrow()` returns fields with `doc` metadata. `make lint` passes, and 
`mkdocs build --strict` passes with the `#union-by-name` link resolving.
   
   ## Are there any user-facing changes?
   
   Docs only. No code changes.
   


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