Skip to content

Passing bytes to table #1425

Closed Answered by sc1f
genderev asked this question in Q&A
May 18, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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 to str:

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(…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@genderev
Comment options

Answer selected by genderev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1424 on May 19, 2021 01:37.