field()¶
freezeframe.column.field
¶
Optional per-column metadata for FrozenFrame field definitions.
field() is only needed when you want to override the default
Python→Arrow type mapping or attach documentation to a column. For the
common case, a bare type annotation is sufficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arrow_type
|
DataType | None
|
Override the Arrow DataType for this column. If omitted, the type is resolved from the annotation via the default mapping. |
None
|
description
|
str
|
Human-readable documentation for this column. Has no runtime effect. |
''
|
Examples:
>>> import pyarrow as pa
>>> from freezeframe import FrozenFrame, field
>>>
>>> class Events(FrozenFrame):
... user_id: int
... score: float = field(arrow_type=pa.float32())
... label: str = field(description="event classification label")