In _py_type_to_arrow_type the branch elif getattr(py_type, "__origin__", None) in (list, tuple) is taken for a bare, unparameterised typing.Tuple/typing.List (their __origin__ is tuple/list). The next line reads py_type.__args__[0], but a bare generic has no __args__, so it raises AttributeError: __args__.
from typing import Tuple
from lancedb.pydantic import LanceModel
class Doc(LanceModel):
items: Tuple
Doc.to_arrow_schema()
Other unsupported types (e.g. Dict[str, int]) correctly raise a clear TypeError; the bare-generic case crashes with an opaque AttributeError instead.
In
_py_type_to_arrow_typethe branchelif getattr(py_type, "__origin__", None) in (list, tuple)is taken for a bare, unparameterisedtyping.Tuple/typing.List(their__origin__istuple/list). The next line readspy_type.__args__[0], but a bare generic has no__args__, so it raisesAttributeError: __args__.Other unsupported types (e.g.
Dict[str, int]) correctly raise a clearTypeError; the bare-generic case crashes with an opaqueAttributeErrorinstead.