See #40818 (comment) for context.
Our constructor functions like pa.array(..), pa.chunked_array(..), pa.record_batch(..) and pa.table(..) accept a type or schema argument.
Those constructors can all be used to consume data that support the Arrow PyCapsule protocol, and to convert those objects to the equivalent pyarrow object. For those cases, it would make sense to also accept the type or schema keyword argument as any object supporting the capsule protocol for schemas, i.e. having a __arro_c_schema__, while right now we require an actual pyarrow object.
One question is whether we would always support schema-like objects with the ArrowSchema protocol as input wherever specifying a type or schema, or whether we only allow this when actually consuming data through the protocol (i.e. if the data object itself has the __arrow_c_array/stream__)
See #40818 (comment) for context.
Our constructor functions like
pa.array(..),pa.chunked_array(..),pa.record_batch(..)andpa.table(..)accept atypeorschemaargument.Those constructors can all be used to consume data that support the Arrow PyCapsule protocol, and to convert those objects to the equivalent pyarrow object. For those cases, it would make sense to also accept the
typeorschemakeyword argument as any object supporting the capsule protocol for schemas, i.e. having a__arro_c_schema__, while right now we require an actual pyarrow object.One question is whether we would always support schema-like objects with the ArrowSchema protocol as input wherever specifying a type or schema, or whether we only allow this when actually consuming data through the protocol (i.e. if the data object itself has the
__arrow_c_array/stream__)