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:
Daniel Gafni
2026-12-03 00:30:12 +00:00
committed by GitHub
parent 03eeb6d1f2
commit b7d83d0362
6 changed files with 507 additions and 13 deletions
+1
View File
@@ -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"]]` |