hi Ryan,

see

http://arrow.apache.org/docs/python/generated/pyarrow.Buffer.html#pyarrow.Buffer

you can call to_pybytes() on the result of serialize()

HTH
Wes

On Thu, Feb 14, 2019 at 4:24 PM Ryan White <ryanmwhite...@gmail.com> wrote:
>
> I've found the deserialize in pa.ipc.read_schema(). From schema.serialize,
> I get a pyarrow Buffer. Do I need to write this to a BufferOutputStream to
> get raw bytes (e.g. sink.getvalue())?
> In Flight, I see this is casted to std:string
> https://github.com/apache/arrow/blob/69d595ae4c61902b3f2778e536fca6675350c88c/cpp/src/arrow/flight/internal.cc#L219
> for the protbuf.
>
> Thanks
>
> Ryan M. White, Ph. D
> www.linkedin.com/in/ryanmwhitephd
> @ryanmwhitephd
> ryanmwhite...@gmail.com
>
>
> On Thu, Feb 14, 2019 at 4:11 PM Ryan White <ryanmwhite...@gmail.com> wrote:
>
> > Hi,
> >
> > I'm using protocol buffers to retain metadata, and I would like to store
> > the Arrow Schema in the protobuf as Arrow is doing in Flight. Looking at
> > the Flight perf.proto, I can do the same and define a bytes field in my
> > proto. From pyarrow, can I serialize/deserialize pyarrow.schema? I've only
> > found pyarrow.schema.serialize() in python/arrow/types.pxi.
> >
> > Thanks,
> >
> >

Reply via email to