mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
fix(python): convert dict fields of Pydantic models to Arrow maps (#5363)
This PR adds support for Arrow [`Map(K,V)`](https://arrow.apache.org/docs/python/generated/pyarrow.map_.html) type to the Pydantic-Arrow schema converter.
This commit is contained in:
@@ -75,6 +75,7 @@ Current supported type conversions:
|
||||
| `str` | `pyarrow.utf8()` |
|
||||
| `list` | `pyarrow.List` |
|
||||
| `BaseModel` | `pyarrow.Struct` |
|
||||
| `dict[K, V]`, `Dict[K, V]` | `pyarrow.Map(K, V)`; keys must be typed and cannot be `Optional` |
|
||||
| `Vector(n)` | `pyarrow.FixedSizeList(float32, n)` |
|
||||
| `Literal["a", "b"]` | the Arrow type of its values, here `pyarrow.utf8()`; every value must have the same type |
|
||||
| `Literal["a", None]` | the same type, nullable, like `Optional[Literal["a"]]` |
|
||||
|
||||
Reference in New Issue
Block a user