-
Support QuestionI tried to copy an example that passed bytes to a I'm not sure what kind of file the (I'm sure the errors produced are due to my own misunderstanding of what a parquet is, but I'm not sure what the proper type of file would be. ) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Here is a good example of loading an Arrow from I am not super familiar with Parquet, but this is the code we use in our tests to convert an Apache Arrow stream = pa.BufferOutputStream()
arrow_table = pyarrow.Table.from_batches([batch])
writer = pyarrow.RecordBatchStreamWriter(stream, arrow_table.schema)
writer.write_table(arrow_table)
writer.close()
table = perspective.Table(stream.getvalue().to_pybytes()) |
Beta Was this translation helpful? Give feedback.
Here is a good example of loading an Arrow from
str
. The ":obj:bytes
|:obj:str
" part of the API docs probably need to be cleared up a bit (along with formatting, it seems)—it does not refer to the ability to load arbitrary strings/bytes, but rather the ability to load CSVs as strings and Apache Arrow-formatted binaries in a byte format.I am not super familiar with Parquet, but this is the code we use in our tests to convert an Apache Arrow
Table
tostr
: