Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mkdocs/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ To create a table using a pyarrow schema:
import pyarrow as pa

schema = pa.schema([
pa.field("foo", pa.string(), nullable=True),
pa.field("foo", pa.string(), nullable=True, metadata={"doc": "Description of foo"}),
pa.field("bar", pa.int32(), nullable=False),
pa.field("baz", pa.bool_(), nullable=True),
])
Expand All @@ -172,6 +172,8 @@ catalog.create_table(
)
```

With a PyArrow schema, a column's description is read only from the `doc` key in the field's metadata and stored as the field's `doc` in the Iceberg schema. [`union_by_name`](#union-by-name) reads the same key, and reading a table back into PyArrow sets it on each field that has a description.

Another API to create a table is using the `create_table_transaction`. This follows the same APIs when making updates to a table. This is a friendly API for both setting the partition specification and sort-order, because you don't have to deal with field-IDs.

```python
Expand Down